Greetings,
Here follow a verse from the Qur'an and two relevant Hadeeth:
Say to those who have disbelieved, if they cease, their past will be forgiven. But if they return (thereto), then the examples of those (punished) before them have already preceded (as a warning). [8:38]
It is recorded in the Sahih that the Messenger of Allah said,
"Islam erases what occurred before it, and repentance erases what occurs before it.''
Amr ibn Al-‘Aas narrates that when his heart entered Islam he went to the Messenger of Allah (peace and blessings of Allaah be upon him) and said, “Give me your hand so that I may pledge allegiance to you.” The Prophet (peace and blessings of Allaah be upon him) spread his hand, but ‘Amr withdrew his.
The Prophet (peace and blessings of Allaah be upon him) asked, “What is wrong ‘Amr?”
Amr said, “I want to make a condition.”
“And what is that?” asked the Prophet (peace and blessings of Allaah be upon him).
“That Allah will forgive me.”
Then the Messenger of Allah said, “Did you not know that Islam wipes out what came before it, and that Hijrah wipes out what came before it, and that Hajj wipes out what came before it” (Sahih Muslim)