Hakeem bin Hizam reported,

I said, "Messenger of Allah, what about things I used to do in the days of ignorance?" Hisham explained that he meant deeds by which he sought righteousness.The Messenger of Allah ﷺ replied, "You have embraced Islam along with all the good you previously did."I said, "By Allah, I will not leave anything I did in the days of ignorance without doing its like in Islam."

Muslim 325

Sahih

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

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

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

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