The Amida on Shabbat is made up of seven berakhot. The formulation of the first and last three berakhot is identical to their weekday versions, but in place of the thirteen berakhot in the middle we recite one special berakha relating to the sanctity of Shabbat. In it we beseech God to find our rest pleasing and to sanctify us with His commandments. We conclude this berakha with “Blessed are You, O Lord, Who sanctifies Shabbat” (“mekadesh ha-Shabbat”). The introduction to this Shabbat berakha was formulated differently by the Sages for each of the prayer services of Shabbat. At Ma’ariv it is “Ata Kidashta” (“You have sanctified”), “Yismaĥ Moshe” (“Moshe rejoiced”) at Shaĥarit, and Ata Eĥad (“You are one”) at Minĥa. One who got confused and recited the wrong berakha – for example, he used the Minĥa formulation during Ma’ariv – has fulfilled his obligation, since the central berakhot of all three prayers share common themes and formulations (SA 268:6; MB ad loc. 14).
Technically, on Shabbat one could say all of the berakhot one usually says during the weekday, and simply add a special berakha for Shabbat. Nevertheless, the Sages wished to honor Shabbat and to avoid burdening the people with lengthy prayers (Berakhot 21a). Furthermore, it is not appropriate to make requests on Shabbat, since they might cause one sorrow (Tanĥuma; Rashi; Rambam). Therefore the Sages reduced Shabbat’s middle berakhot from thirteen to one. However, if one mistakenly started to say the berakhot from the weekday Amida, and then remembered in the middle of one of the berakhot, he should finish the berakha and then shift to the Shabbat formulation. Since the weekday berakha is still relevant, and he has already begun it, it is proper that he finish it (SA 268:2). If he made a mistake and did not say the berakha about Shabbat, as long as he has not finished the Amida he can go back to the Shabbat berakha and continue from there until the end of the Amida. However, if he already finished the Amida, even if he has not yet stepped backward, he must repeat the Amida from the beginning (ibid. 5).
The Sages also established an additional prayer service on Shabbat – Musaf – corresponding to the extra sacrifices that were offered on Shabbat during Temple times. In this Amida too, the first three and last three berakhot are the same as those of every Amida, but in the middle there is a special berakha about the Musaf sacrifice and the sanctity of Shabbat.
. If during Musaf one mistakenly began to recite the weekday berakhot, and then remembered that he must pray Musaf, even though some maintain that he should finish the berakha, he should not do so. Rather, he should stop immediately, because those berakhot are not relevant to Musaf (SA 265:2; MB ad loc. 5).
If while praying the Amida he began to say the word “ata” with the intention of continuing with the berakha of “Ata Ĥonen” but then remembered that it was Shabbat, what should he do? If he was praying the Amida of Ma’ariv or Minĥa on Shabbat day, whose Shabbat berakhot also begin with the word “ata,” he should continue with the correct Shabbat formulation. But if he was praying Shaĥarit, since he intended to begin a weekday berakha and indeed did so, he should finish the berakha of Ata Ĥonen. Nevertheless, even in Shaĥarit if he recited “ata” absentmindedly, he should correct himself and continue with the correct berakha, Yismaĥ Moshe, since in theory if he were to continue during Shaĥarit with Ata Kidashta of Ma’ariv or Ata Eĥad of Minĥa he would fulfill his obligation (SA 265:3; MB ad loc. 6; Ben Ish Ĥai, Year 2, Toldot 10).