`Uqbah ibn `Amir (may Allah be pleased with him) narrated that the Messenger of Allah (peace be upon him) said: "The example of those who do bad deeds then do righteous deeds is like a man who wore a tight armor that was almost choking him then he did a righteous deed causing one of the armor's rings to be loose then he did another righteous deed causing another ring to be loose until he got out to a wide space (after his armor was loose)." (1)
Explanation of the Hadith:(2)
The Hadith exhorts people to rush to repentance when they commit a sin, and doing righteous deeds after it because righteous deeds expiate bad deeds as Allah (may He be Exalted) says: "Verily, the good deeds remove the evil deeds (i.e. small sins)." [Surat Hud: 114].
So, a person who does a bad deed then did a good deed is as if he was in severe distress then got out to a wide space that is full of good deeds.
Imam Al Munawy said: The meaning is that doing bad deeds tightens the chest and the provision of the wrongdoer puts him in amaze and causes people to hate him. However, when he does righteous deeds, his good deeds expiate his bad deeds and when his bad deeds, his chest is expanded, his provision is expanded, his matters become easy, and all people shall love him. (3)
Lessons gained from the Hadith:
1- The excellence of doing righteous deeds and showing that they are the reason for raising degrees and expiating bad deeds.
2- Showing the Mercy of Allah (may He be Exalted) toward His Servants because when He afflicted them with sins, He supported them with repentance, good deeds which erases sins, and great ordeals which expiate sins, among others. So, a Muslim should do frequent righteous deeds to push away the impact of sins.
3- Righteous deeds are not rewarded except if they are done sincerely for the sake of Allah and should be right; Sincere deeds should be solely for Allah and the true should be done according to the Sunnah.
(1) Reported by Imam Ahmad in his Musnad, 28/ 543, No. (17307) and Al Albany graded it as authentic. See: As-Silsilah As-Sahihah, 7/ 55, No. (2854)
(2) See: Faydul-Qadir of Al Munawy, 2/ 520.
(3) See: Faydul-Qadir of Al Munawy, 2/ 520.