If an apostate repents, does he have to make up the fasts that he missed before he apostatised?
Question

Someone apostatised from Islam then came back, and before he apostatised he had some fasts that he had to make up. Does he still have to make them up, or are they waived in his case because Islam erases that which came before it? Does the ruling include the days for which he is not certain whether he has to make them up, on which he did some things which he does not know whether they broke the fast or not?
Praise be to Allah.Firstly:
The scholars differed regarding this issue, and there are two views:
The view of the Malikis is that if the apostate becomes Muslim, he is not obliged to make up what he had missed of prayers or fasts before he apostatised. In that regard, he is like a disbeliever who becomes Muslim.
But they limited that to one who did not apostatise so that the obligation of making up the missed acts of worship will be waived for him. If he did that, then making them up is not waived for him, as a punishment to him for his bad intention.
Al-Kharashi said in Sharh Qawl Khalil: Prayer, fasting, zakah and Hajj are waived, as explained above.
What is meant is that if one who is accountable fell short in acts of worship such as prayer, fasting or zakah before he apostatised, then he repented and came back to Islam, he is not to be instructed to make them up. That is waived in his case, because Islam erases what came before it, and he becomes like a disbeliever who just became Muslim. But what he did of Hajj before he apostatised is not valid; rather he has to do the obligatory Hajj.
We should not here that the ruling concerning shortcomings in these acts of worship applies provided that he did not intend his apostasy for the purpose of waiving them; if he did that, then they are not waived in his case.
The majority are of the view that it is obligatory to make up the acts of worship that he did not do before he apostatised.
It says in al-Mawsu‘ah al-Fiqhiyyah (22/201): If the apostate who has repented owed any prayers, fasts or zakah that he missed before he apostatised, does he have to make them up?
The majority of Hanafi, Shafa‘i and Hanbali jurists are of the view that he is obliged to make them up, because failing to do an act of worship is a sin, and sins remain after apostatising. End quote.
Secondly:
If the apostate repents, he does not have to make up the prayers and fasts that he did not do during the time when he was an apostate, because repentance erases what came before it.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: As for the apostate, he does not have to make up what he missed of prayer, zakah and fasting during the time when he was an apostate, according to the well-known view, but he must make up what he missed before he apostatised, according to the well-known view."(Majmu‘ al-Fatawa  22/10).
Shaykh Ibn Baz (may Allah have mercy on him) was asked:
Does the apostate have to make up prayers and fasts when he comes back to Islam and repents to Allah?
He replied: He does not have to make them up. When someone repents, Allah turns to him in mercy, and if a person does not pray, or he does any of the things that nullify Islam, then Allah guides him and he repents, then he does not have to make up [the missed acts of worship].
This is the correct scholarly view, because Islam erases what came before it, and repentance erases what came before it. Allah, He be glorified and exalted, says (interpretation of the meaning):
{Say to those who have disbelieved [that] if they cease, what has previously occurred will be forgiven for them} [al-Anfal 8:38].
Thus Allah stated that if the disbeliever becomes Muslim, Allah will forgive him his previous sins.
And the Prophet (blessings and peace of Allah be upon him) said: “Repentance erases that which came before it, and Islam erases that which came before it.”"(Majmu‘ Fatawa Ibn Baz 29/196).
See also the answer to question no. 197247 .
And Allah knows best.