Question: I forgot it was a taanis and made myself a cup of tea. What’s the halacha now that I’ve broken the taanis?
Answer: The Shulchan Aruch (OC 568:1) writes that if one accidentally ate on a taanis tzibbur, communal fast day, one must continue fasting. The Mishna Berura (568:1) adds that this applies equally to one who purposely ate.
The Rema (Darkei Moshe OC) and Magen Avraham (568:4) quote the Maharil who instructed one who accidentally ate on asara b’teves to fast three fasts as an atonement. The Kaf Hachaim (OC 549:7) writes that while this incident occurred on asara b’teves, this halacha would apply equally to any other taanis tzibbur. Nonetheless, the Magen Avraham and Kaf Hachaim quote the Terumas Hadeshen (156) who writes that this is not required.
Thus, while the Shulchan Aruch writes that one who broke a personal fast would have to make up for breaking it by fasting on another day, the Mishna Berura (568:8) writes that this doesn’t apply to one who ate on a taanis tzibbur.
The Mishna Berura (568:3) writes that even if one has eaten, they may still say aneinu in mincha. Yet, elsewhere (Biur Halacha 565:1) he quotes the Chayei Adam who maintains that one who isn’t fasting should omit aneinu. R’ Shmuel Wosner (Shevet Halevi 5:60:4; 8:131) explains the difference. One who cannot fast due to ill health, etc. cannot say aneinu as they are exempt. One who has eaten on their fast, can say it, however, as they are still obligated to fast.
In conclusion, if one accidentally ate or drank on a taanis, one must continue fasting until the end of the day. One should still say aneinu in mincha.