Shaykh Ahmad bin Yahya an-Najmi (Rahimahullaah) was asked:

What is the ruling if a person forgets and ears or drinks?

“If the fasting person ate and drank whilst he was forgetful, it does not invalidate his fast, because of the Hadeeth “Whoever forgets and eats and drinks, he shall complete his fast, for indeed Allaah gave him food and drink”.

Fath al-Rab al-Wadood Fil Fataawa wa al-Risaail wal Rudood 323 / 1