Praise be to Allah.
If a person falls into kufr (disbelief) or apostasy, then repents to Allah and comes to Islam sincerely, Allah will accept his repentance and turn his bad deeds into good deeds, as He has promised, and Allah does not break His promise.
It is not right for a person to doubt this. A number of scholars have clearly stated that repentance from kufr is definitely accepted, unlike repentance from sins, as some said it is definitely accepted and some said it may or may not be accepted.
Al-Nawawi (may Allah have mercy on him) said in Sharh Muslim: The repentance of the kafir (disbeliever) from his kufr is definitely accepted, but is any other kind of repentance definitely accepted or likely to be accepted? There is a difference of opinion among Ahl al-Sunnah (followers of the Prophetic way) concerning this, and Imam al-Haramayn was of the view that it is likely, and this is the more correct view. And Allah knows best. End quote.
Al-‘Iraqi said in Tarh al-Tathreeb (8/40): Repentance expiates for major sins, and there is consensus on this. But is its expiation definite or likely? With regard to repentance from kufr, it is definite, but with regard to other major sins, the scholars of Ahl al-Sunnah disagreed. Al-Nawawi said: The strongest view is that it is likely. The Mu’tazilah (a deviant sect) were of the view that repentance should be accepted on the basis of reason (as it was their way to refer everything to reason).
Abu’l-‘Abbas al-Qurtubi said: What I say is that the one who studies shariah on the basis of the Quran and Sunnah (traditions of the Prophet), and follows what is in them with regard to this topic knows for certain that Allah accepts the repentance of those who are sincere. End quote.
Ibn ‘Ashoor said in al-Tahreer wa’l-Tanweer (1/914): The scholars of Ahl al-Sunnah fall into two groups: One group is of the view that repentance is definitely accepted because there are reports to support that. The large number of reports indicates that this is definitive. End quote.
To sum up: the one who repents from kufr and apostasy should be optimistic, because Islam erases whatever came before it, as the Prophet (peace and blessings of Allah be upon him) said to ‘Amr ibn al-‘As (may Allah be pleased with him): “Do you not know that Islam destroys whatever came before it?” Narrated by Muslim (121).
Allah says (interpretation of the meaning):
“How shall Allah guide a people who disbelieved after their Belief and after they bore witness that the Messenger (Muhammad – peace and blessings of Allah be upon him) is true and after clear proofs had come unto them? And Allah guides not the people who are Zalimoon (polytheists and wrongdoers).
They are those whose recompense is that on them (rests) the Curse of Allah, of the angels, and of all mankind.
They will abide therein (Hell). Neither will their torment be lightened, nor will it be delayed or postponed (for a while).
Except for those who repent after that and do righteous deeds. Verily, Allah is Oft-Forgiving, Most Merciful.”
[Al- ‘Imran 3:86-89]
This includes one whose kufr involved the practice of witchcraft. If he repents to Allah, Allah will accept his repentance. This is a matter that is between him and his Lord. As for the acceptance of a magician’s repentance in this world, this is subject to further discussion, as has been explained in the answer to question no. 69914.
With regard to hoping that repentance is accepted without being certain of it, this has to do with repentance from sins that are less serious than kufr. This means that the person still fears that his repentance may not have been accepted, but he hopes that his Lord will accept it. This does not mean that he should doubt that his faith is accepted or that his doubt is like the doubt of the hypocrites, rather he is certain of his faith, but he fears that Allah may punish him for his sins if He does not accept his repentance.
What you should do is turn to Allah and keep yourself busy with obeying and worshipping Him, and think positively of Him. You should know that He accepts those who repent to Him and He honours those who obey Him, and He loves those who seek His forgiveness; He rejoices over those who come back to Him, and He draws them close to Him and grants them happiness and opens their hearts and fills their hearts with light; He endears to them obedience and remembrance of Him. So strive to be one of them, and do not pay any attention to the whispers of the shaytan (devil), because he wants to put people off from repenting and make them despair, so that they will carry on in their misguidance. He says to people: how can Allah accept your repentance when you did such and such? Why make it hard on yourself when you are going to be rejected anyway? This is part of his lies and tricks and misguidance. Allah is more merciful towards His slave than a mother is towards her child. Hence He has made it easy to repent and has increased the reward of the penitent, and He stretches forth His hand by night to accept the repentance of the one who sinned during the day, and He stretches forth His hand during the day to accept the repentance of the one who sinned during the night.
So repent to Allah and be optimistic of goodness and success.
May Allah increase us and you in guidance, help, prosperity and success.
And Allah knows best.