You have embraced Islam along with your past good deeds
Hakīm ibn Hizām (may Allah be pleased with him) reported:
I said: "O Messenger of Allah, before embracing Islam, I used to do good deeds, like giving in charity, manumitting slaves, and upholding kinship ties. Shall I be rewarded for those deeds?" The Prophet (may Allah’s peace and blessings be upon him) replied: "You have embraced Islam along with your past good deeds."
قُلْتُ: يَا رَسُولَ اللَّهِ، أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَتَحَنَّثُ بِهَا فِي الجَاهِلِيَّةِ مِنْ صَدَقَةٍ أَوْ عَتَاقَةٍ، وَصِلَةِ رَحِمٍ، فَهَلْ فِيهَا مِنْ أَجْرٍ؟ فَقَالَ النَّبِيُّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ: «أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ».
The Prophet (may Allah's peace and blessings be upon him) points out that if a disbeliever embraces Islam, he gets rewarded for the good deeds he used to perform in Jāhiliyyah, before becoming Muslim, like charity, manumission of slaves, and upholding of kinship ties.
أتحنث: أتعبد.
The good deeds of a disbeliever will not be rewarded in the Hereafter if he dies as a disbeliever.
Sahīh Al-Bukhāri (2/ 114) (1436).
Sahīh Muslim (1/ 113) (123).
More (5)
المفهم (1/332).
شرح النووي على مسلم (2/140).
عمدة القاري شرح صحيح البخاري (22/ 96).
فتح الباري لابن حجر (3/ 302).
البحر المحيط الثجاج (3/499).