The one who repents from sin is like one who did not sin
Question

If a girl used to do the secret habit and has repented from it, does she have to do anything? Or is she like one who committed zina with her boyfriend, meaning that she should be flogged 100 times?
Praise be to Allah.The secret habit (masturbation) is haraam. We have explained that in the answer to question no. 329 . But it is not like zina (fornication), which is subject to the hadd punishment. The zina which is subject to the hadd punishment is intercourse only.
The one who does that must hasten to give it up, ask his Lord, may He be glorified and exalted, for forgiveness, and regret what he has done. He must realise that it causes a great deal of harm in spiritual, mental and physical terms. There is no specific punishment for it in the religious texts, and the matter of punishment for it is up to Allah, may He be glorified and exalted, because it is one of the prohibited actions that do not incur a hadd punishment.
If a person repents sincerely from any sin – whether it is the secret habit or anything else – then if Allah, may He be exalted, accept his repentance and forgives his sin, it will be as if the sin never happened. Allah, may He be exalted, says (interpretation of the meaning):
{And it is He who accepts repentance from His servants and pardons misdeeds, and He knows what you do} [ash-Shoora 42:25]
{Say, O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful} [az-Zumar 39:53].
This verse is speaking of the one who repents: Allah, may He be exalted, will forgive him all the sins from which he repents.
The Prophet (blessings and peace of Allah be upon him) said: “The one who repents from sin is like the one who did not sin.” Narrated by Ibn Maajah (4250); classed as saheeh by al-Albaani in Saheeh Ibn Maajah.
Please see also the answers to questions no. 10445 and 13436 .
And Allah knows best.