—that is the better course.
In other words, it is permissible for a person who has committed a sin that carries a prescribed punishment—such as adultery—to go to the ruler or other competent authority and say, “I have done such-and-such; administer the ḥadd (prescribed punishment) to me,” for the ḥadd serves as an expiation for the offense.
As for all other sins, conceal them just as Allah has concealed them for you; even acts of adultery and the like should remain hidden from everyone except the ruler. Do not expose yourself.
So long as you have repented sincerely between yourself and Allah, He accepts the repentance of His servants and effaces their misdeeds.
If, however, the wrongdoing involves other people’s rights, the matter is different. When the right concerns property, you must return it to its owner; repentance is not accepted without that. If you stole someone’s money and then repented, you must restore the stolen property to the person from whom it was taken.
Likewise, if you denied someone his due—for example, you owed a debt and then disowned it—after repenting you must go to that creditor, acknowledge the debt, and let him take what is his. If he has died, pay his heirs. If you cannot locate them, or the person himself has disappeared and you have no way of finding him, then give the amount away in charity on his behalf to free yourself of the obligation. Allah, exalted be He, knows it and will deliver it to him.
Should the sin you committed against another person involve striking him or something similar, go to him and allow him to strike you in the same way you struck him: if it was on the back, then on the back; if on the head, then on the head; wherever you hit him, let him exact retaliation. This accords with Allah’s words, “The recompense of an evil deed is an evil deed like it” (Q 42:40), and His words, “So whoever transgresses against you, retaliate against him to the extent that he transgressed against you” (Q 2:194).