Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "Allah Almighty expressed wonder at a servant who went out for jihad; his companions were defeated, and he realised what (duty) was upon him, so he went back until his blood was shed. Allah Almighty says to His angels: Look at My servant; he went back out of hope for what is with Me and out of fear of what (punishment) is with Me, until he was killed."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17930