Bulugh al-Maram, Book 5, Hadith 690 (English)

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 )‏، واللفظ لمسلم.‏

sunnah.com

also referenced under: Book 5, Hadith 669 (In-Book)