Good Replaces Bad
The Messenger of Allah (sal Allahu alaihi wa sallam) said: “No man does a wrong action then performs Wudu and does his Wudu well, then performs two Rakaat and seeks Allah’s forgiveness, but that He will forgive him.” [Ahmad]
Similar is Allah’s promise in the Quran: “Except the one who repents and believes and does good deeds, then Allah will replace the evil deeds of such people by good deeds, and Allah is Most-Forgiving, Very-Merciful.” [Surah Al-Furqan, Ayat 70]
A true repentance will not only remove the bad deed from your record, but will actually convert it into a good deed. Once you have realized your mistake, make Wudu properly and then pray two Rakaat seeking Allah’s forgiveness.