Short answer
They are wiped away. A man named Amr came to the Prophet (ﷺ) to accept Islam, then pulled back his hand. He wanted to be sure his past would be forgiven first. The Prophet (ﷺ) asked him whether he did not know that Islam wipes out all that came before it. The Qur'an promises even more. For those who repent, believe and do good, God (﷾) changes their bad deeds into good ones. It also says that God (﷾) forgives all sins to those who turn back to Him, so no one should despair of His mercy. The Bible taught the same through Ezekiel: if the wicked man turns from his sins, none of them will be held against him. That is the mercy Islam offers.
Full explanation
Islam wipes out what came before it
Amr ibn al-As had once been among the Prophet's (ﷺ) bitterest enemies. When he came to accept Islam, he held his hand back from the pledge. He asked for one condition: that he be forgiven. The Prophet (ﷺ) told him that Islam wipes out everything before it. The Qur'an says the same to those who had opposed the faith. If they stop, their past will be forgiven.
Amr ibn al-As, near death, said that before Islam no one was more hateful to him than the Prophet (ﷺ), and he had wished to kill him. He told how he came to the Prophet to accept Islam. He asked the Prophet to stretch out his right hand so he could pledge, then drew his own hand back. Asked why, he said he wanted a condition: that he be forgiven. The Prophet asked whether he did not know that Islam wipes out everything that came before it.
“Say to the Unbelievers, if (now) they desist (from Unbelief), their past would be forgiven them; but if they persist, the punishment of those before them is already (a matter of warning for them).”
Sins changed into good deeds
The Qur'an names the gravest sins, including worshipping other gods, murder and adultery. Then it makes an exception for whoever repents, believes and does good. God (﷾) will change their evil deeds into good. It tells everyone who has wronged himself not to despair of God's (﷾) mercy. God (﷾) forgives all sins to those who turn back to Him.
“Those who invoke not, with Allah, any other god, nor slay such life as Allah has made sacred except for just cause, nor commit fornication; - and any that does this (not only) meets punishment. (But) the Penalty on the Day of Judgment will be doubled to him, and he will dwell therein in ignominy,- Unless he repents, believes, and works righteous deeds, for Allah will change the evil of such persons into good, and Allah is Oft-Forgiving, Most Merciful,”
“Say: "O my Servants who have transgressed against their souls! Despair not of the Mercy of Allah: for Allah forgives all sins: for He is Oft-Forgiving, Most Merciful.”
How deeds are written from then on
The Prophet (ﷺ) said that a person may mean to do a good deed and not do it. It is still written for him as a good deed. If he does it, it is written ten to seven hundred times over, or more. A bad deed he means to do but holds back from is written as a good deed. If he does it, it is written as one bad deed only, and God (﷾) may wipe even that out.
The Prophet (ﷺ) said that Allah has recorded good and bad deeds. Whoever intends a good deed and does not do it has one full good deed written for him; if he does it, ten to seven hundred good deeds or more are written. Whoever intends a bad deed and does not do it has one full good deed written for him; if he does it, one bad deed is written. Another chain of the same hadith adds that Allah may even wipe it out.
A person accepts Islam.
What happens to the sins before it?
Islam wipes out everything that came before it.
And for one who repents, believes and does good?
God (﷾) changes their bad deeds into good ones.
How are deeds written from then on?
A good deed is written ten to seven hundred times over, or more. A bad deed is written once, and God (﷾) may wipe even that out.
No one should despair of God's (﷾) mercy: He forgives all sins to those who turn back to Him.
The Christian view of forgiveness
Christians teach that sin is forgiven through the death of Jesus. They cite Hebrews, a letter in the New Testament, which says that without the shedding of blood there is no remission of sins.
“And almost all things are by the law purged with blood; and without shedding of blood is no remission.”
The Bible taught the same
Yet the prophet Ezekiel says that if the wicked man turns from all his sins and does what is right, he will live. None of his sins will be mentioned to him. No sacrifice is named. God (﷾) forgives the one who turns back. Jesus himself told the Pharisees, a Jewish group of religious teachers, to learn what it means that God (﷾) wants mercy and not sacrifice.
“But if the wicked will turn from all his sins that he hath committed, and keep all my statutes, and do that which is lawful and right, he shall surely live, he shall not die. All his transgressions that he hath committed, they shall not be mentioned unto him: in his righteousness that he hath done he shall live.”
“But go ye and learn what that meaneth, I will have mercy, and not sacrifice: for I am not come to call the righteous, but sinners to repentance.”
Verse by verse
Hebrews 9:22 — Epistle to the Hebrews, chapter 9, verse 22
“And almost all things are by the law purged with blood; and without shedding of blood is no remission.”
Cited for
Sin can only be forgiven through shed blood, so forgiveness needs the sacrifice of Jesus.
The response
Hebrews itself says "almost all things". The Law of Moses let a poor man bring flour as a sin offering, with no blood, and he was forgiven. The prophets say more. Ezekiel promises that the wicked man who turns from his sins will live, with none of them mentioned to him. He names no sacrifice. Jesus told the Pharisees that God (﷾) wants mercy, not sacrifice. And in Jesus' own parable, a teaching story, the lost son comes home to confess. His father "ran, and fell on his neck, and kissed him". No sacrifice comes before the father's welcome.
Where it lands — The Bible's own prophet, and Jesus himself, teach that God (﷾) forgives the one who turns back. That is what Islam teaches.
Perspectives
Christian
Christians teach that forgiveness comes through faith in the death of Jesus, whose blood, they say, was shed for sin.
Hebrews says that without the shedding of blood there is no remission of sins.
Rebuttal
The Law Hebrews speaks of let a poor man bring flour, with no blood, and says "it shall be forgiven him". Hebrews itself says "almost all things". Ezekiel and Jesus teach that God (﷾) forgives the one who turns back.
The Islamic perspective
Whoever accepts Islam starts with a clean record. The Prophet (ﷺ) said Islam wipes out all that came before it. God (﷾) can turn a repentant person's sins into good deeds. No blood is needed. Ezekiel too promised life to the wicked man who turns back, and named no sacrifice.
The Prophet Muhammad (ﷺ) told Amr ibn al-As that Islam wipes out everything that came before it.
The Qur'an promises that those who stop opposing the faith will have their past forgiven.
The Qur'an speaks of those who repent, believe and do good. It teaches that God (﷾) changes their evil deeds into good deeds.
The Qur'an teaches that God (﷾) forgives all sins to those who turn to Him.
The Prophet Muhammad (ﷺ) taught that good deeds are multiplied, while a bad deed is written only once.
Ezekiel teaches that the wicked man who turns from his sins will live. His sins will not be mentioned to him.