Hakeem bin Hizam reported,

I asked, "Messenger of Allah, what do you say about things I used to do in the days of ignorance as acts of devotion, such as giving charity, freeing slaves, and maintaining ties of kinship? Is there any reward for me in them?"The Prophet ﷺ replied, "You have embraced Islam along with all the good you did before."

Azami 12381

Sahih

عن حكيم بن حزام قال

قلت: يا رسول الله أرأيت أشياء كنت أتحنث بها في الجاهلية، من صدقة أو عتاقة وصلة رحم، فهل فيها من أجر، فقال النبي ﷺ: أسلمت على ما سلف من خير.

الأعظمي 12381صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Say to those who disbelieve, if they cease, what has passed will be forgiven for them, and if they return, then the precedent of the former peoples has already passed"
Numbering
Jami al-Kamil 12381 (2nd edition)
Azami 12381