From Sahih Bukhari (Hadith 4067):
Narrated Al-Bara' bin `Azib:The Prophet (ﷺ) appointed `Abdullah bin Jubair as the commander of the cavalry archers on the day of the battle of Uhud. Then they returned defeated, and that is what is referred to by Allah's Statement:-- "And the Apostle (Muhammad) was in your rear calling you back
Reference: Bukhari 4067