All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If anything from the stomach rises, such as food, vomit, or that acid (gastric juice), and if it reaches the mouth so that it is possible to spit it out, yet the fasting person swallows it intentionally, then his fasting is invalidated by that. If it does not reach the mouth in this way, i.e. it is not possible to spit it out and then it returns to the stomach again, the fasting is not invalidated.
Allah knows best.