That which is correct from the statements of the scholars is that his actions are not nullified unless he dies upon disbelief. Based upon the verse:
وَمَن يَرْتَدِدْ مِنكُمْ عَن دِينِهِ فَيَمُتْ وَهُوَ كَافِرٌ فَأُوْلـئِكَ حَبِطَتْ أَعْمَـلُهُمْ فِي الدُّنْيَا وَالاٌّخِرَةِ وَأُوْلـئِكَ أَصْحَـبُ النَّارِ هُمْ فِيهَا خَـلِدُونَ –
“And whosoever of you turns back from his religion and dies as a disbeliever, then his deeds will be lost in this life and in the Hereafter, and they will be the dwellers of the Fire. They will abide therein forever”
For an action to be nullified, two conditions must be met:
- Dying upon apostasy.
Therefore, that which is bound to two conditions does not become valid with the presence of only one of them, and this is the view of Imam Shafii and his companions as well as Ahmed from one of his narrations and a group of his companions as well.
[Fathul ‘Allam Of Sheikh Mohamed Ibn Hizzam hafidahu’Allah, V1, pg 428]