The Prophet (ﷺ) said, "If somebody eats something forgetfully while he is fasting, then he should complete his fast, for Allah has made him eat and drink."
Sahih al-Bukhari Book 83, Hadith 47