إِلَّا مَن تَابَ وَءَامَنَ وَعَمِلَ عَمَلًا صَـٰلِحًا فَأُو۟لَـٰٓئِكَ يُبَدِّلُ ٱللَّهُ سَيِّـَٔاتِهِمْ حَسَنَـٰتٍ ۗ وَكَانَ ٱللَّهُ غَفُورًا رَّحِيمًا
Illaa man taaba wa 'aamana wa 'amila 'amalan saalihan fa ulaaa'ika yubad dilul laahu saiyi aatihim hasanaat; wa kaanal laahu Ghafoorar Raheemaa
Except those who repent, believe, and do righteous deeds — for them God will replace their evil deeds with good ones. God is ever forgiving, ever merciful.
The clause about substitution goes further than pardon: the verb baddala means to exchange one thing for another, so something takes the place of what is removed. Commentators differed over what changes — whether the record of past wrongs is itself converted, or whether the person's future conduct takes the place of the old. The verse sits directly after the heaviest list of sins in the surah, and it is addressed to exactly those people.