Narrated Ibn Mas`ud:
A man said, “O Allah’s Messenger (peace be upon him)! Shall we be punished for what we did in the Prelslamic Period of ignorance?” The Prophet (peace be upon him) said, “Whoever does good in Islam will not be punished for what he did in the Pre-lslamic Period of ignorance and whoever does evil in Islam will be punished for his former and later (bad deeds).
Sahih al-Bukhari, Vol. 9, Book 88, Hadith 4

previous post