عَنْ أَنَسِ بْنِ مَالِكٍ رَضِيَ اللَّهُ عَنْهُ قَالَ خَرَجَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فِي غَدَاةٍ قَرَّةٍ أَوْ بَارِدَةٍ فَإِذَا الْمُهَاجِرُونَ وَالْأَنْصَارُ يَحْفِرُونَ الْخَنْدَقَ فَقَالَ اللَّهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَةِ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَةِ فَأَجَابُوهُ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدًا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدًا
It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) went out on a cold morning and saw that the Muhajirun and Ansar were digging the trench. So the Prophet (peace and blessings be upon him) said: O Allah! The real goodness is the goodness of the Hereafter, so forgive the Ansar and the Muhajirun. In response, the Companions said: We are those who have pledged allegiance to Muhammad (peace and blessings be upon him) that we will continue to strive in jihad as long as we live.