Urwah bin al-Zubayr (may Allah have mercy on him) narrates from Sayyiduna Hakim bin Hizam (may Allah be pleased with him) that he said: I said: "O Messenger of Allah (peace and blessings be upon him), what do you think of the things I used to do as acts of devotion in the Jahiliyyah, such as freeing slaves and maintaining ties of kinship: will I have any reward for them?" He (peace and blessings be upon him) said: "You have embraced Islam along with the good you did before."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21596
Hakim bin Hizam (may Allah be pleased with him) says: I said: "O Messenger of Allah (peace and blessings be upon him), what do you think of what I used to do as an act of devotion in the Jahiliyyah?" Hisham said: That is, I used to do it as an act of righteousness. The Messenger of Allah (peace and blessings be upon him) said: "You have embraced Islam along with the good you did before." He said: "O Messenger of Allah (peace and blessings be upon him), whatever I used to do purely for Allah in the Jahiliyyah, I will do the same in Islam." He had freed a hundred slaves in the Jahiliyyah, so after accepting Islam he also freed a hundred slaves; and he had offered a hundred camels as sacrifice in the Jahiliyyah, and in Islam too he offered a hundred camels as sacrifice.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21597