Hakeem bin Hizam reported,

He informed him that he said to the Messenger of Allah ﷺ, "Messenger of Allah, what do you think of acts of devotion I used to perform in the days of ignorance, such as charity, freeing slaves, and maintaining ties of kinship? Will I be rewarded for them?"The Messenger of Allah ﷺ replied, "You have embraced Islam with all the good you previously did."

Muslim 324

Sahih

و حدثنا حسن الحلواني وعبد بن حميد قال الحلواني حدثنا وقال عبد حدثني يعقوب وهو ابن إبراهيم بن سعد حدثنا أبي عن صالح عن ابن شهاب قال أخبرني عروة بن الزبير أن

حكيم بن حزام

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

مسلم 324صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Faith
Chapter
Ruling on the deeds of a disbeliever if he accepts Islam afterward
Numbering
Darussalam 324
Muslim 324