alkafi-3045Vol. 2, p. 461
مَنْ كَانَ مُؤْمِناً فَعَمِلَ خَيْراً فِي إِيمَانِهِ ثُمَّ أَصَابَتْهُ فِتْنَةٌ فَكَفَرَ ثُمَّ تَابَ بَعْدَ كُفْرِهِ كُتِبَ لَهُ وَ حُوسِبَ بِكُلِّ شَيْءٍ كَانَ عَمِلَهُ فِي إِيمَانِهِ وَ لَا يُبْطِلُهُ الْكُفْرُ إِذَا تَابَ بَعْدَ كُفْرِهِ.
“One who has been a believer and had performed good deeds then suffers a misfortune and turns to disbelief, then after disbelief repents, all of the good deeds that he had performed as a believer will be written down for him. Disbelief does not invalidate them if he repents after his disbelief.”