1. The Book of Faith

١۔ كتاب الإيمان

1.57 Clarifying the ruling of the action of an unbeliever if he accepts Islam after it

١۔٥٧ باب بَيَانِ حُكْمِ عَمَلِ الْكَافِرِ إِذَا أَسْلَمَ بَعْدَهُ

Converting to Islam does not erase the reward for any of the good done before Islam

(77) bukhari:1436ʿAbdullāh b. Muḥammad > Hishām > Maʿmar > al-Zuhrī > ʿUrwah > Ḥakīm b. Ḥizām

I asked the Messenger of Allah ﷺ, "Before embracing Islam I used to do good deeds like giving in charity, freeing slaves, and the keeping of good relations with kith and kin. Shall I be rewarded for those deeds?" The Prophet ﷺ replied, "You became Muslim ˹along˺ with ˹the rewards for˺ all those good deeds ˹you have done in the past and without carrying the sin of any of the bad deeds of the past˺."  

(٧٧) البخاري:١٤٣٦حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ حَدَّثَنَا هِشَامٌ حَدَّثَنَا مَعْمَرٌ عَنِ الزُّهْرِيِّ عَنْ عُرْوَةَ عَنْ حَكِيمِ بْنِ حِزَامٍ ؓ قَالَ

قُلْتُ يَا رَسُولَ اللَّهِ، أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَتَحَنَّثُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ صَدَقَةٍ أَوْ عَتَاقَةٍ وَصِلَةِ رَحِمٍ فَهَلْ فِيهَا مِنْ أَجْرٍ؟ فَقَالَ النَّبِيُّ ﷺ: «أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ.»