Ali 'Imran 3:195
فَٱسْتَجَابَ لَهُمْ رَبُّهُمْ أَنِّى لَآ أُضِيعُ عَمَلَ عَـٰمِلٍ مِّنكُم مِّن ذَكَرٍ أَوْ أُنثَىٰ ۖ بَعْضُكُم مِّنۢ بَعْضٍ ۖ فَٱلَّذِينَ هَاجَرُوا۟ وَأُخْرِجُوا۟ مِن دِيَـٰرِهِمْ وَأُوذُوا۟ فِى سَبِيلِى وَقَـٰتَلُوا۟ وَقُتِلُوا۟ لَأُكَفِّرَنَّ عَنْهُمْ سَيِّـَٔاتِهِمْ وَلَأُدْخِلَنَّهُمْ جَنَّـٰتٍ تَجْرِى مِن تَحْتِهَا ٱلْأَنْهَـٰرُ ثَوَابًا مِّنْ عِندِ ٱللَّهِ ۗ وَٱللَّهُ عِندَهُۥ حُسْنُ ٱلثَّوَابِ
Fastajaba lahum rabbuhumannee la odeeAAu AAamala AAamilin minkum minthakarin aw ontha baAAdukum min baAAdinfallatheena hajaroo waokhrijoo min diyarihimwaoothoo fee sabeelee waqataloo waqutiloolaokaffiranna AAanhum sayyi-atihim walaodkhilannahum jannatintajree min tahtiha al-anharu thawabanmin AAindi Allahi wallahu AAindahu husnuaththawab
And their Lord responded to them, "Never will I allow to be lost the work of [any] worker among you, whether male or female; you are of one another. So those who emigrated or were evicted from their homes or were harmed in My cause or fought or were killed - I will surely remove from them their misdeeds, and I will surely admit them to gardens beneath which rivers flow as reward from Allāh, and Allāh has with Him the best reward."
So, their Lord answered their prayer: “I do not allow the labour of any worker from among you, male or female, to go to waste. You are similar to one another. So, those who emigrated, and were expelled from their homes, and were tortured in My way, and fought, and were killed, I shall certainly write off their evil deeds, and shall certainly admit them into gardens beneath which rivers flow, as a reward from Allah. It is Allah with Whom lies the beauty of the reward.