‘Uqba b. ‘Amir reported God’s messenger as saying, “One who does evil deeds and afterwards does good deeds is like a man who was wearing a tight coat of mail which choked him, then did a good deed and a ring was loosened, then did another and another was loosened, so that it fell at last to the ground.”
It is transmitted in Sharh as-sunna.