It is narrated on the authority of Abdullah bin Mas'ud that some people said to the Messenger of Allah (peace and blessings of Allah be with him): Messenger of Allah, would we be held responsible for our deeds committed in the state of ignorance (before embracing Islam)? Upon this he (the Holy Messenger) remarked: He who amongst you performed good deeds in Islam, he would not be held responsible for them (misdeeds which he committed in ignorance) and he who committed evil (even after embracing Islam) would be held responsible for his misdeeds that he committed in the state of ignorance as well in that of Islam.
This hadith throws a good deal of light on approach of Islam towards good and evil. Islam is not a mere expression of a few words but a complete submission of one's life to Allah. It is a wholehearted change, both in thought and deed. Now if a man makes a profession of Islam but he brings about no change in his life, it means that he has not accepted Islam in the heart of his hearts.
Faith is not something inert; it is dynamic in the sense that it revolutionises the whole of life of a man. If one accepts Islam and then leads a virtuous and pious life in accordance with its teachings, all his previous misdeeds would be wiped off as he has proved that he sincerely wants a healthy change in his life and is prepared to put earnest efforts for his moral uplift.
The hadith is an elucidation of the verse of the Qur'an, “Verily virtue wipes off vices” (11:114). This Islamic injunction presents a striking contrast to all those religions which believe that an evil act once committed is like a fixed deposit in the balance sheet of a man's deeds or a permanent entry in his character roll.
According to Islam, misdeeds can be effaced by good deeds as it does not close its door eternally to a man. Allah is Merciful, Compassionate and He is always ready to grant him pardon and admit him to His Grace provided he is prepared to change his attitude and behaviour.