Narrated Abu Sa`id: The Prophet said, "Amongst the people preceding your age, there was a man whom Allah had given a lot of money. While he was in his death-bed, he called his sons and said, 'What type of father have I been to you? They replied, 'You have been a good father.' He said, 'I have never done a single good deed; so when I die, burn me, crush my body, and scatter the resulting ashes on a windy day.' His sons did accordingly, but Allah gathered his particles and asked (him), 'What made you do so?' He replied, "Fear of you.' So Allah bestowed His Mercy upon him. (forgave him).
Hadith Referenceصحيح البخاري / كتاب أحاديث الأنبياء / 3478
Hadith Gradingمحدثین:أحاديث صحيح البخاريّ كلّها صحيحة
Hadith Commentary: His action was contrary to the belief in Allah’s power, but he did this at a time when he was overwhelmed by fear; on this basis, he was deprived of deliberation and reflection, and he had forgotten everything. Because of such circumstances, he was not held accountable for it. In any case, this person had faith in Allah, because when Allah asked him, he replied that it was Your fear that prompted him to do this. If, in a state of intense fear, someone says or does something that would otherwise cause him to leave the fold of Islam, he will not be held accountable for it.
Source: Hidayat al-Qari: Commentary on Sahih Bukhari, Urdu, Page: 3478