Sahih Bukhari | Volume 3 | Hadith Number 423

Narrated by 'Urwa bin Az-Zubair
Hakim bin Hizam said, "O Allah's Apostle! I used to do good deeds in the Pre-Islamic period of Ignorance, e.g., keeping good relations with my Kith and kin, manumitting slaves and giving alms. Shall I receive a reward for all that?" Allah's Apostle replied, "You embraced Islam with all the good deeds which you did in the past."