Accidentally eating or drinking does not break one's fast
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."
عَنِ النَّبِيِّ ﷺ قَالَ إِذَا نَسِيَ فَأَكَلَ وَشَرِبَ فَلْيُتِمَّ صَوْمَهُ فَإِنَّمَا أَطْعَمَهُ اللَّهُ وَسَقَاهُ