Narrated Abu Hurairah (Radi Allahu Anhu): The Prophet (Sal Allahu alaihi wa sallam) 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 (Subhanahu wa ta’ala).”
(Reference : Sahih al-Bukhari 1933
In-book reference : Book 30, Hadith 40).
Alhamdulillah for the mercies we are blessed with! Your fast will not be affected by your forgetfulness In shaa Allah! We are held accountable for what we knowingly do and not what is inadvertent.