Messenger of Allah, do you think that if I am killed in the way of Allah, my sins will be blotted out from me? The Messenger of Allah ﷺ said: Yes, in case you are killed in the way of Allah and you were patient and sincere and you always fought facing the enemy, never turming your back upon him. Then he added: What have you said (now)? (Wishing to have further assurance from him for his satisfaction), he asked (again): Do you think if I am killed in the way of Allah, all my sins will be obliterated from me? The Messenger of Allah ﷺ said: Yes, it you were patient and sincere and always fought facing the enemy and never turning your back upon him, (all your lapses would be forgiven) except debt. Gabriel has told me this. (Using translation from Muslim 1885a)
قَامَ رَسُولُ اللهِ ﷺ يَخْطُبُ النَّاسَ فَذَكَرَ الْإِيمَانَ بِاللهِ وَالْجِهَادَ فِي سَبِيلِ اللهِ مِنْ أَفْضَلِ الْأَعْمَالِ عِنْدَ اللهِ قَالَ فَقَامَ رَجُلٌ فَقَالَ يَا رَسُولَ اللهِ أَرَأَيْتَ إِنْ قُتِلْتُ فِي سَبِيلِ اللهِ وَأَنَا صَابِرٌ مُحْتَسِبٌ مُقْبِلٌ غَيْرَ مُدْبِرٍ كَفَّرَ اللهُ عَنِّيخَطَايَايَ؟ قَالَ نَعَمْ قَالَ فَكَيْفَ قُلْتَ؟ قَالَ فَرَدَّ عَلَيْهِ الْقَوْلَ كَمَا قَالَ قَالَ نَعَمْ قَالَ فَكَيْفَ قُلْتَ؟ قَالَ فَرَدَّ عَلَيْهِ الْقَوْلَ أَيْضًا قَالَ يَا رَسُولَ اللهِ أَرَأَيْتَ إِنْ قُتِلْتُ فِي سَبِيلِ اللهِ صَابِرًا مُحْتَسِبًا مُقْبِلًا غَيْرَ مُدْبِرٍ كَفَّرَ اللهُ عَنِّي خَطَايَايَ؟ قَالَ نَعَمْ إِلَّا الدَّيْنَ فَإِنَّ جِبْرِيلَ سَارَّنِي بِذَلِكَ