Anas bin Malik reported,

The Prophet ﷺ went out one cold morning and found the Muhajirun and the Ansar digging the trench. He said, "O Allah, the true good is the good of the Hereafter, so forgive the Ansar and the Muhajirun."They answered him, "We are the ones who pledged allegiance to Muhammad to strive in jihad as long as we live."

Ahmad 12951

Sahih

حدثنا عبيدة عن حميد الطويل

عن أنس بن مالك قال

خرج النبي ﷺ في غداة قرة أو باردة فإذا المهاجرون والأنصار يحفرون الخندق فقال اللهم إن الخير خير الآخره فاغفر للأنصار والمهاجره فأجابوه نحن الذين بايعوا محمدا على الجهاد ما بقينا أبدا

أحمد 12951صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 12951
Ahmad 12951