Shabbos 19:3-4
Shabbos 19:3
One may bathe an infant on Shabbos both before and after the bris by sprinkling water by hand but not by using a vessel. Rabbi Elazar ben Azariah says that one may wash a child when the third day after a bris falls on Shabbos, as derived from Genesis 34:25, “on the third day, when they were in pain….” If there is a doubt about the child, or if he possesses both sets of genitals, he is not circumcised on Shabbos. Rabbi Yehuda permits a hermaphrodite to be circumcised on Shabbos.
Shabbos 19:4
If a mohel had two babies to circumcise, one on Shabbos and one after Shabbos, and he made a mistake, circumcising the wrong one on Shabbos, he is liable. If he had two babies, one to circumcise before Shabbos and one on Shabbos, and he made a mistake, circumcising the wrong one on Shabbos, Rabbi Eliezer says he is liable (because circumcision only supersedes Shabbos when performed in its proper time) and Rabbi Yehoshua says he is exempt (because he still performed a mitzvah).