Sunnah.com reference : Book 5, Hadith 20English translation : Book 5, Hadith 690Arabic reference : Book 5, Hadith 669
Abu Hurairah (RAA) narrated that The Messenger of Allah (ﷺ) said:
‘Whoever forgets that he is fasting, and eats or drinks is to complete his fast, as it was Allah who fed him and gave him something to drink." Agreed upon.
وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ مَنْ نَسِيَ وَهُوَ صَائِمٌ, فَأَكَلَ أَوْ شَرِبَ, فَلْيُتِمَّ صَوْمَهُ, فَإِنَّمَا أَطْعَمَهُ اَللَّهُ وَسَقَاهُ }  مُتَّفَقٌ عَلَيْهِ  1‏ .‏‏1 ‏- صحيح.‏ رواه البخاري ( 1933 )‏، ومسلم ( 1155 )‏، واللفظ لمسلم.‏