The Prophet (ﷺ) said, "If somebody eats or drinks forgetfully then he should complete his fast, for what he has eaten or drunk, has been given to him by Allah."
Sahih al-Bukhari Book 30, Hadith 40