The Rules of Forgetfulness (Sahw) in Prayer
Man Lā Yaḥḍuruh al-Faqīh|Volume 1|Book 1|Chapter 50
وَ رَوَى اَلْحَلَبِيُّ عَنْهُ عَلَيْهِ اَلسَّلاَمُ أَنَّهُ قَالَ: «إِذَا لَمْ تَدْرِ أَرْبَعاً صَلَّيْتَ أَوْ خَمْساً أَمْ زِدْتَ أَمْ نَقَصْتَ فَتَشَهَّدْ وَ سَلِّمْ وَ اُسْجُدْ سَجْدَتَيِ اَلسَّهْوِ بِغَيْرِ رُكُوعٍ وَ لاَ قِرَاءَةٍ تَتَشَهَّدُ فِيهِمَا تَشَهُّداً خَفِيفاً.
Al-Halabi narrated from him (the Prophet عليه السلام) that He said: “If you are unsure whether you prayed four or five rak'ahs, or whether you added or omitted something, then perform the tashahhud (testification of faith), say salaam (greeting of peace), and prostrate two prostrations of forgetfulness without bowing or reciting (in them), and you will make a brief tashahhud in both of them.”
- Ṣaḥīḥ al-Faqīh