Beyond this, that verse affords them no proof at all, because Allah, exalted is He, did not say in it, “If you associate partners with Him, every deed you performed before committing associationism will be nullified.” Adding such a clause to the speech of Allah is impermissible. He only informed us that a person’s deeds are annulled after he commits associationism and then dies upon it—not when he embraces Islam—and this is an undeniable fact.
Thus, were a polytheist to perform ḥajj, ʿumrah, prayer, fasting, or zakāh, none of that would discharge the obligation upon him. Moreover, His words in the same verse, “and you will certainly be among the losers” (Q 39:65), make it clear that an apostate who returns to Islam does not have any of his earlier good deeds nullified; rather, they are recorded for him and he will be recompensed for them with Paradise. There is unanimous agreement in the Ummah that an apostate who comes back to Islam is not among the losers but among those who profit, prosper, and succeed. It follows, then, that the one whose deeds are nullified is the person who dies upon disbelief—whether he apostatised after Islam or was always an unbeliever—and such a person is undoubtedly among the losers, not the one who accepts Islam after disbelief or returns to it after apostasy.
Allah the Exalted says, “Whoever among you turns back from his religion and dies while he is a disbeliever—it is they whose deeds have come to nothing” (Q 2:217). This explicit text confirms our assertion that a person’s deeds are not nullified by apostasy unless he dies as a disbeliever. We also find Allah saying, “I do not allow the deeds of any doer among you, male or female, to go to waste” (Q 3:195), and, “Whoever does an atom’s weight of good will see it” (Q 99:7). These are general statements that admit of no exception. Hence, if he returns to Islam, he will indeed see (the benefit of) his ḥajj and ʿumrah; they will not be lost to him.
We have likewise transmitted—through chains of transmission as radiant as the sun—from al-Zuhrī and from Hishām ibn ʿUrwah, both reporting from ʿUrwah ibn al-Zubayr, that Ḥakīm ibn Ḥizām informed him that he said to the Messenger of Allah (peace and blessings be upon him): “O Messenger of Allah, what is your view regarding deeds I used to perform in the pre-Islamic era—giving charity, manumitting slaves, and maintaining family ties? Will I receive a reward for them?” The Messenger of Allah (peace and blessings be upon him) replied, “You have entered Islam along with whatever good you had previously done.”