Abu Hurairah reported,

The Prophet ﷺ led one of the two afternoon prayers. Muhammad said, "I think it was most likely the Asr prayer." He prayed two rakahs and then made the closing salam. He then stood up and walked to a piece of wood at the front of the mosque and placed his hand on it. Among the people present were Abu Bakr and Umar رضي الله عنهم, but they were too in awe of him to speak.Those in a hurry left, saying, "Has the prayer been shortened?"A man whom the Prophet ﷺ used to call Dhul Yadayn asked, "Did you forget, or has the prayer been shortened?"The Prophet ﷺ replied, "I have not forgotten, nor has it been shortened."Dhul Yadayn said, "Yes, you have forgotten."So he prayed the remaining two rakahs and then made the closing salam. Then he said the takbir and prostrated like his usual prostration or longer, then he raised his head and said the takbir, then he placed his head down again with the takbir and prostrated like his usual prostration or longer, then he raised his head with the takbir.

Bukhari 1229

Sahih

حدثنا حفص بن عمر حدثنا يزيد بن إبراهيم عن محمد

عن أبي هريرة رضي الله عنه قال

صلى النبي ﷺ إحدى صلاتي العشي قال محمد وأكثر ظني العصر ركعتين ثم سلم ثم قام إلى خشبة في مقدم المسجد فوضع يده عليها وفيهم أبو بكر وعمر رضي الله عنهما فهابا أن يكلماه وخرج سرعان الناس فقالوا أقصرت الصلاة ورجل يدعوه النبي ﷺ ذو اليدين فقال أنسيت أم قصرت فقال لم أنس ولم تقصر قال بلى قد نسيت فصلى ركعتين ثم سلم ثم كبر فسجد مثل سجوده أو أطول ثم رفع رأسه فكبر ثم وضع رأسه فكبر فسجد مثل سجوده أو أطول ثم رفع رأسه وكبر

البخاري 1229صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Forgetfulness
Chapter
Whoever says takbir in the two prostrations of forgetfulness
Numbering
Darussalam 1229
Bukhari 1229