Let's assume that a law is unjust and many folk are being punished for breaking said law.
I am suggesting that a bill should be generated to rescind that law. This passes through the U.S. Senate and the U.S. House of Representatives, and then stamped by the president.
In consequence all who have been convicted of breaking that law are pardoned by the courts. This is the way it should work in my opinion.
If you've got an obstructionist party in the Senate and/or House that bill may never see the light of day no matter how justified.
It may also take months or even years to get the bill passed even if it makes it onto the legislative agenda. Why force people to stay in prison while the bill meanders its way through the legislature ?