Hadith 1020

Al-Mughira b. Shu'ba reported God’s Messenger as saying, “When an imam stands up at the end of two rak'as, if he remembers before standing straight up he should sit down, but if he stands straight up he must not sit down, but perform the two prostrations of forgetfulness.” Abu Dawud and Ibn Majah transmitted it.

وَعَنِ الْمُغِيرَةِ بْنِ شُعْبَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِذَا قَامَ الْإِمَامُ فِي الرَّكْعَتَيْنِ فَإِنْ ذَكَرَ قَبْلَ أَنْ يَسْتَوِي قَائِما فليجلس وَإِنِ اسْتَوَى قَائِمًا فَلَا يَجْلِسْ وَلْيَسْجُدْ سَجْدَتَيِ السَّهْو» . رَوَاهُ أَبُو دَاوُدَ وَابْنُ مَاجَهْ

Reference: 5610200
In-book reference: Book 4, Hadith 1020