حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ نُمَيْرٍ، حَدَّثَنَا وَكِيعٌ، وَأَبِي، عَنِ الأَعْمَشِ، عَنْ شَقِيقٍ، عَنْ عَبْدِ اللَّهِ، قَالَ قُلْنَا ‏:‏ يَا رَسُولَ اللَّهِ أَنُؤَاخَذُ بِمَا كُنَّا نَفْعَلُ فِي الْجَاهِلِيَّةِ فَقَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏:‏ ‏"‏ مَنْ أَحْسَنَ فِي الإِسْلاَمِ لَمْ يُؤَاخَذْ بِمَا كَانَ فِي الْجَاهِلِيَّةِ وَمَنْ أَسَاءَ أُخِذَ بِالأَوَّلِ وَالآخِرِ ‏"‏ ‏.‏

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 (PBUH) 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.’” Translation Not Available

Book Ref: Sunan Ibn Majah Book 37 Hadith 4242
Web Ref:  Sunan Ibn Majah Vol 5 Book 37 Hadith 4242