[Machine] I asked, "O Messenger of Allah, what do you think about the things I used to do during the time of ignorance (before Islam)? Can I justify them?" The Messenger of Allah ﷺ said, "You have embraced Islam and all the previous good deeds (before Islam) count." Hisham said, "He (the Messenger of Allah) used to free slaves even during the time of ignorance."
قُلْتُ يَا رَسُولَ اللهِ أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَصْنَعُهَا فِي الْجَاهِلِيَّةِ أَتَبَرَّرُ بِهَا؟ فَقَالَ رَسُولُ اللهِ ﷺ «أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ» قَالَ هِشَامٌ «وَكَانَ أَعْتَقَ فِي الْجَاهِلِيَّةِ»