It is narrated from Sayyiduna Uqbah bin Amir (may Allah be pleased with him) that he heard the Messenger of Allah (peace and blessings be upon him) say: "The example of one who commits evil deeds and then does good deeds is like that of a man wearing a tight coat of mail that is choking him. Then he does a good deed and one ring comes loose, then he does another and another ring comes loose, until he comes out (free of the coat of mail) onto the ground."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14855