It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: When any one of you is fasting and forgetfully eats or drinks something, he should still complete his fast, for it is Allah who has fed him and given him drink.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 9136
Hadith Gradingحکم دارالسلام:حديث صحيح، خ: 6669، م: 1155، وهذا سند قوي متصل من جهة ابن سیرین، ومنقطع من جهة خلاس، وأما رواية الحسن فمرسلة