Abu Hurairah (RAA) narrated that The Messenger of Allah (ﷺ) said:
وَعَنۡ أَبِي هُرَيۡرَةَ - رضى الله عنه - قَالَ: قَالَ رَسُولُ اَللَّهِ - صلى الله عليه وسلم -{ مَنۡ نَسِيَ وَهُوَ صَائِمٌ, فَأَكَلَ أَوۡ شَرِبَ, فَلۡيُتِمَّ صَوۡمَهُ, فَإِنَّمَا أَطۡعَمَهُ اَللَّهُ وَسَقَاهُ } مُتَّفَقٌ عَلَيۡهِ 1 .1 - صحيح. رواه البخاري ( 1933 )، ومسلم ( 1155 )، واللفظ لمسلم.
Translation
From Abu Hurayrah رضي الله تعالى عنه, who said: The Messenger of Allah صلى الله عليه وآله وسلم said, “If someone forgets while fasting and eats or drinks, let him complete his fast, for Allah has fed him and given him drink.” Agreed upon. [1] Authentic. Al-Bukhari (1933) and Muslim (1155) transmitted it, the wording being Muslim's.