Wow, I can't believe no one can think of any instances where laws were enforced retroactively. Anyone heard of the French Revolution? Almost an entire class of people were wiped out, for things that had been perfectly acceptable and legal before the revolution. Somewhat the same thing happened in England after Cromwell killed Charles I. In Germany, after the reformation, the constituent states of the HRE were all forced to adopt the specific faith tenents of their rulers. If an old ruler died and his heir was of a different faith, while the population in general were allowed to peacefully change religions, the religious leaders were often not granted that courtesy, and executed/exiled for their past religious activities. Same thing again in England, when Henry VIII dumped the Catholic church for his own version, many of the religious were punished without a chance to convert.
Edit: forgot what happened after the first Haitian revolution, when all the slaves freed themselves. Google that sometime.
Now, all of these examples are pretty grim, not exactly examples of justice. Many times in the world there have been attempts to majorly change societies from one accepted truth to its opposite, and it is usually quite messy. So, I have a small proposal.
Many societies in the world have/have had the concept of the blood price, a payment made by the guilty (often those of a higher class/caste than the victim) to the relatives of those unjustly killed, in exchange for which the relatives give up all rights, both legal and extra-legal, to vengeance for the death.
So, just have a standard fine to from all slave owners that would be split up between all of their slaves, that would cover both wages not received and any past injustices/deaths that may have occured. I'm thinking something like 80% of all liquid assets would do, plus maybe 50% of all real property reverting to the crown to be redistributed....