‘Uqbah ibn ‘Amir reported: The Messenger of Allah, peace and blessings be upon him, said, “Verily, the parable of one who commits a sin and then performs a good deed is that of a man wearing a tightened iron chain choking his neck. Then, he performs a good deed and one of its rings loosens, then he performs another good deed and one of its rings loosens again, until he is set free to walk the earth.”
Source: Musnad Aḥmad 17307
Source: Hasan (fair) according to Al-Arna’ut
عَنْ عُقْبَةَ بْنَ عَامِرٍ قَالَ قَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ إِنَّ مَثَلَ الَّذِي يَعْمَلُ السَّيِّئَاتِ ثُمَّ يَعْمَلُ الْحَسَنَاتِ كَمَثَلِ رَجُلٍ كَانَتْ عَلَيْهِ دِرْعٌ ضَيِّقَةٌ قَدْ خَنَقَتْهُ ثُمَّ عَمِلَ حَسَنَةً فَانْفَكَّتْ حَلْقَةٌ ثُمَّ عَمِلَ حَسَنَةً أُخْرَى فَانْفَكَّتْ حَلْقَةٌ أُخْرَى حَتَّى يَخْرُجَ إِلَى الْأَرْضِ
17307 مسند أحمد بن حنبل
28/543 المحدث شعيب الأرناؤوط خلاصة حكم المحدث إسناده حسن في تخريج المسند