A man came to the Prophet ﷺ and said, "Messenger of Allah, I ate and drank while fasting, having forgotten."The Prophet ﷺ replied, "It was Allah who fed you and gave you drink."
حدثنا موسى بن إسمعيل حدثنا حماد عن أيوب وحبيب وهشام عن محمد بن سيرين
جاء رجل إلى النبي ﷺ فقال يا رسول الله إني أكلت وشربت ناسيا وأنا صائم فقال الله أطعمك وسقاك
No references are available.
[Its isnad is sahih] Bukhari narrated it in the Book of Fasting, chapter "The Fasting Person Who Eats or Drinks Forgetfully," hadith 1933, and Muslim in the Book of Fasting, chapter "Eating, Drinking, or Having Intercourse Forgetfully Does Not Break the Fast," hadith 1155, from the hadith of Hisham, in abbreviated form, without the story of the man.