Abu Hurairah (RA) reported Allah's Messenger (ﷺ) as saying: If anyone forgets that he is fasting and eats or drinks he should complete his fast, for it is only Allah Who has fed him and given him drink.
Hadith ReferenceSahih Muslim / The Book of Fasting / Hadith: 1155