حَدَّثَنَا
مُحَمَّدُ بْنُ يُوسُفَ، عَنْ
سُفْيَانَ، عَنْ
الْأَعْمَشِ، عَنْ
أَبِي وَائِلٍ، عَنْ
عَبْدِ اللَّهِ رَضِيَ اللهُ عَنْهُ، قَالَ: قَالَ رَجُلٌ: يَا رَسُولَ اللَّهِ صَلَّي اللَّهُ عَلَيْهِ وَسَلَّمَ: أَيُؤَاخَذُ الرَّجُلُ بِمَا عَمِلَ فِي الْجَاهِلِيَّةِ ؟، قَالَ:
"مَنْ أَحْسَنَ فِي الْإِسْلَامِ لَمْ يُؤَاخَذْ بِمَا كَانَ عَمِلَ فِي الْجَاهِلِيَّةِ، وَمَنْ أَسَاءَ فِي الْإِسْلَامِ، أُخِذَ بِالْأَوَّلِ وَالْآخِرِ".
It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him): A man submitted, "O Messenger of Allah! If a person committed a sin in the time of ignorance (before accepting Islam), will he be held accountable for it?" The Prophet (peace and blessings be upon him) said: "Whoever does good deeds after accepting Islam will not be held accountable for the sins of his time of ignorance, but whoever does evil deeds after accepting Islam, he will be held accountable and taken to task for both his earlier and later periods."
Related hadith on this topic