Language:
كتاب الجهاد والسير
56  
Fighting for the Cause of Allah (Jihaad)
(97)
Chapter: Whoever arranged his companions at the time of defeat, and got down from his riding animal and requested Allah for help
(97)
باب مَنْ صَفَّ أَصْحَابَهُ عِنْدَ الْهَزِيمَةِ وَنَزَلَ عَنْ دَابَّتِهِ، وَاسْتَنْصَرَ
Sahih al-Bukhari 2930

Narrated Abu 'Is-haq:

A man asked Al-Bara', "O Abu '`Umara! Did you all flee on the day (of the battle) of Hunain?" He replied, "No, by Allah! Allah's Messenger (ﷺ) did not flee, but his young unarmed companions passed by the archers of the tribe of Hawazin and Bani Nasr whose arrows hardly missed a target, and they threw arrows at them hardly missing a shot. So the Muslims retreated towards the Prophet (ﷺ) while he was riding his white mule which was being led by his cousin Abu Sufyan bin Al-Harith bin `Abdul Muttalib. The Prophet (ﷺ) dismounted and invoked Allah for victory; then he said, 'I am the Prophet, without a lie; I am the son of `Abdul Muttalib, and then he arranged his companions in rows."

حَدَّثَنَا عَمْرُو بْنُ خَالِدٍ، حَدَّثَنَا زُهَيْرٌ، حَدَّثَنَا أَبُو إِسْحَاقَ، قَالَ سَمِعْتُ الْبَرَاءَ، وَسَأَلَهُ، رَجُلٌ أَكُنْتُمْ فَرَرْتُمْ يَا أَبَا عُمَارَةَ يَوْمَ حُنَيْنٍ قَالَ لاَ، وَاللَّهِ مَا وَلَّى رَسُولُ اللَّهِ صلى الله عليه وسلم، وَلَكِنَّهُ خَرَجَ شُبَّانُ أَصْحَابِهِ وَأَخِفَّاؤُهُمْ حُسَّرًا لَيْسَ بِسِلاَحٍ، فَأَتَوْا قَوْمًا رُمَاةً، جَمْعَ هَوَازِنَ وَبَنِي نَصْرٍ، مَا يَكَادُ يَسْقُطُ لَهُمْ سَهْمٌ، فَرَشَقُوهُمْ رَشْقًا مَا يَكَادُونَ يُخْطِئُونَ، فَأَقْبَلُوا هُنَالِكَ إِلَى النَّبِيِّ صلى الله عليه وسلم وَهْوَ عَلَى بَغْلَتِهِ الْبَيْضَاءِ، وَابْنُ عَمِّهِ أَبُو سُفْيَانَ بْنُ الْحَارِثِ بْنِ عَبْدِ الْمُطَّلِبِ يَقُودُ بِهِ، فَنَزَلَ وَاسْتَنْصَرَ ثُمَّ قَالَ أَنَا النَّبِيُّ لاَ كَذِبْ أَنَا ابْنُ عَبْدِ الْمُطَّلِبْ ثُمَّ صَفَّ أَصْحَابَهُ‏.‏
Reference : Sahih al-Bukhari 2930
In-book reference : Book 56, Hadith 143
USC-MSA web (English) reference : Vol. 4, Book 52, Hadith 181
  (deprecated numbering scheme)