If a person mistakenly recited the Shabbat morning Amida ("Yismah Moshe") on Friday night, or the Shabbat afternoon Amida ("Ata Ehad") on Shabbat morning, he has nevertheless fulfilled his obligation, and does not have to then recite the proper Amida. This is the ruling of the Shulhan Aruch. Since the person recited the paragraph of "Reseh Na Bi’mnuhatenu," which is the most important portion of the Shabbat Amida prayer, he has fulfilled his obligation. The sections of "Ata Kidashta" on Friday night, "Yismah Moshe" on Shabbat morning, and "Ata Ehad" on Shabbat afternoon are expressions of praise, but not the primary section of the Amida prayer. Therefore, if one recited the wrong section, he does not have to then repeat the correct Amida, since he recited the critical portion of "Reseh Na Bi’mnuhatenu."
In Bet Yosef, Maran cites the view of the Shibolet Ha’leket (Rav Sidkiyahu Ben Abraham, Italy, 13th century) that this Halacha does not apply to Musaf. According to this view, if one mistakenly recited the Amida for Musaf in one of the other Shabbat prayers, or if one recited the Amida of one of the other Shabbat prayers for Musaf, he has not fulfilled his obligation. The Musaf prayer deals with the Musaf sacrifice, and it thus differs fundamentally from all the other Amida prayers of Shabbat. The Shibolet Ha’leket therefore maintained that it cannot be substituted with another Amida, and the other Amida prayers cannot be substituted with the Amida of Musaf.
Maran cites this view in the Shulhan Aruch as a "Yesh Omrim" ("There are those who say…"), but codifies as the "Stam" (primary view) the ruling that one fulfills his obligation even by substituting Musaf with another Amida prayer, or vice versa. Many later scholars raised the question of why Maran did not accept the view of the Shibolet Ha’leket, and the Magen Abraham (Rav Abraham Gombiner, Poland, 1637-1682) wrote that he did not find any source disputing the Shibolet Ha’leket’s ruling. The Hida (Rav Haim Yosef David Azulai, 1724-1807) discusses this issue in his Yosef Ometz (69), and in his Mahazik Beracha he notes that the other view is indeed found in other sources (Rama Mi’Pano, Tosefet Shabbat).
In any event, Hacham Ovadia Yosef rules that since the Shulhan Aruch accepted the position that one does not recite a new Amida if he mistakenly substituted the Amida of Musaf with another Amida of Shabbat, or vice versa, this is the Halacha we should follow. Therefore, if one mistakenly recited the Amida of any of the Shabbat prayers in a different Shabbat prayer, including Musaf, he has fulfilled his obligation and does not then have to recite the correct Amida.
Summary: If a person recited in a Shabbat prayer the Amida of a different Shabbat prayer, he has nevertheless fulfilled his obligation and does not then have to recite the correct Amida. This applies regardless of which prayer was substituted for a different prayer, such as if one mistakenly recited the Amida for Shaharit at Arbit, or the Minha prayer at Musaf, the Musaf prayer at Shaharit, and so on.