Sahih Muslim 1805 d
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
اللَّهُمَّ إِنَّ الْخَيْرَ خَيْرُ الآخِرَهْ فَاغْفِرْ لِلأَنْصَارِ وَالْمُهَاجِرَهْ "
It has been narrated (through a still difterent chain of transmitters) by Anas that the Companions of Muhammad (ﷺ) were chanting on the day of the Battle of the Ditch:
We are those who have sworn allegiance to Muhammad (And made a covenant with him) to follow Islam as long as we live. Hammad is not sure whether Anas said:" Ala'l-Islam" or," Ala'l-Jihad". And the Prophet (ﷺ) was chanting: O God, the real good is the good of the Hereafter, So forgive You the Ansar and the Muhajirs.
Full reference and source
Sahih Muslim 1805 d In-book : Book 32, Hadith 158 USC-MSA web (English) : Book 19, Hadith 4448 (deprecated)
View source on Sunnah.com (opens in a new tab)