It wasnarrated that 'Abdullah said:
"We said: 'O Messenger of Allah,will we be taken to task for what we did in the Ignorance period?'TheMessenger of Allah (ﷺ) said: 'Whoever does good in Islam(i.e.,after becoming a Muslim) he will not be taken to task for whathe didin the Ignorance period, but whoever does evil (i.e., afterenteringIslam) he will be taken to task for both the former and thelatter.'"
English reference: Vol. 5, Book 37, Hadith 4242
Arabic reference: Book 37, Hadith 4383