The Book of Fasting
13/33. Chapter:
The one who eats, drinks, or has intercourse by mistake does not break his fast
Sahih Muslim
وَحَدَّثَنِي عَمْرُو بْنُ مُحَمَّدٍ النَّاقِدُ، حَدَّثَنَا إِسْمَاعِيلُ بْنُ إِبْرَاهِيمَ، عَنْ هِشَامٍ الْقُرْدُوسِيِّ، عَنْ مُحَمَّدِ بْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ، - رضى الله عنه - قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مَنْ نَسِيَ وَهُوَ صَائِمٌ فَأَكَلَ أَوْ شَرِبَ فَلْيُتِمَّ صَوْمَهُ فَإِنَّمَا أَطْعَمَهُ اللَّهُ وَسَقَاهُ " .
Abu Huraira reported Allah's Messenger (ﷺ) as saying: If anyone forgets that he is fasting and eats or drinks he should complete his fast, for it is only Allah Who has fed him and given him drink.
Reference : Sahih Muslim 1155In-book reference : Book 13, Hadith 222USC-MSA web (English) reference : Book 6, Hadith 2575