Sayyiduna Hakim bin Hizam (may Allah be pleased with him) says that I said: "O Messenger of Allah (peace and blessings be upon him)! What is your (peace and blessings be upon him) view about deeds such as freeing slaves and maintaining ties of kinship that I did in the Jahiliyyah; will I receive reward for them?" The Prophet (peace and blessings be upon him) said: "You have accepted Islam, and the good you did remains for you."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18293