صحيح البخاري Sahih Bukhari كتاب الزكاة The Book of Zakat
بَابُ مَنْ تَصَدَّقَ فِي الشِّرْكِ ثُمَّ أَسْلَمَ:

(24) Chapter. Whoever gave things in charity while he was a Mushrik and then embraced Islam.

1 hadith
Hadith 1436
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ ، حَدَّثَنَا هِشَامٌ ، حَدَّثَنَا مَعْمَرٌ ، عَنِ الزُّهْرِيِّ ، عَنْ عُرْوَةَ , عَنْ حَكِيمِ بْنِ حِزَامٍ رَضِيَ اللَّهُ عَنْهُ , قَالَ : " قُلْتُ يَا رَسُولَ اللَّهِ ، أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَتَحَنَّثُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ صَدَقَةٍ أَوْ عَتَاقَةٍ وَصِلَةِ رَحِمٍ ، فَهَلْ فِيهَا مِنْ أَجْرٍ ؟ فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ " .
Narrated Hakim bin Hizam: I said to Allah's Apostle, "Before embracing Islam I used to do good deeds like giving in charity, slave-manumitting, and the keeping of good relations with Kith and kin. Shall I be rewarded for those deeds?" The Prophet replied, "You became Muslim with all those good deeds (Without losing their reward)."
Hadith Reference Sahih Bukhari / The Book of Zakat / Hadith: 1436
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة