that his major sins might be exposed. Then He will say, ‘I have forgiven them for you and replaced each evil deed with a good deed.’ At that point he will say, ‘My Lord, I have other evil deeds that I do not yet see.’”
When a believing servant repents and Allah replaces his evil deeds with good deeds, those evil deeds that once harmed him become, through his repentance, good deeds by which Allah benefits him. After repentance, his sins no longer harm him; rather, repenting of them is among the most beneficial things for him. What counts is the perfection of the outcome, not the deficiency of the beginning. Thus, someone who forgets the Quran and then memorizes it, becoming better than he was when he first memorized it, has not been harmed by forgetting. Likewise, someone who falls ill and then recovers and grows strong has not been harmed by that passing illness.
Allah Most High tests His believing servant with things of which he repents, so that through this he may attain a degree of perfection in servitude, humble entreaty, humility before Allah, turning to Him, utmost vigilance in the future, and diligence in worship that he would not have attained without repentance. This is like someone who experiences hunger, thirst, illness, poverty, and fear, then experiences fullness, quenched thirst, health, wealth, and security. He comes to love these blessings, appreciate their sweetness, take pleasure in them, desire them, thank Allah for bestowing them upon him, and guard against returning to his former condition in ways he would not have done without that experience. This has been discussed at length elsewhere.
It should be understood that repentance is indispensable for every believer. Only through it can anyone attain perfection, achieve complete nearness to Allah, and be freed of everything he dislikes.