Violating a law which had been struck down but is later reinstated

Suppose on January 1, the legislature passes and executive signs a law outlawing X.

On February 1, a judge strikes down the law as unconstitutional.

On March 1, someone violates this law and is charged with the crime or violation by the police/DA.

On April 1, an appeals court overturns the initial judicial ruling, and the law gets reinstated.

Now it’s May 1, and the “violator” is facing trial. Does he get to argue that at the time he committed this act, the law had been struck down by the court? Or is the overturning by the appeals court retroactive?

Same goes for violating a regulation or executive order.

I would have to think that the appeals ruling is not retroactive, but IANAL and would like this confirmed. (Especially since a ruling striking down a law would be retroactive.)

A defendant cannot be retroactively guilty of a crime when an act has been committed when the act was legal.

I believe a Constitutional Amendment addresses this very issue.

That’s the constitutional provision against ex post facto laws. It’s in the original Constitution: Article I, Section 9, paragraph 3. That may or may not apply to the scenario in the OP.