Laws for Making up for a Missed Prayer - Part 2
When making up a missed prayer one must always pray the obligatory prayer first. For example, if one missed Shacharit he must first pray Mincha, and only afterwards make up the Shacharit that he missed. Therefore, if someone had in mind that he was praying the Shacharit that he missed before praying the obligatory Mincha, it does not count. He must still pray Mincha, and afterwards make-up the missed Shacharit. If one prayed both the make up Shacharit and obligatory Mincha (in that order), he only needs to pray again for the missed Shacharit. (Shulchan Aruch Orach Chaim 108:1)
The Magen Avraham and Taz argue with the above ruling. They maintain that one only repeats the Shemoneh Esrei if he switches the order in a clear and overt way (not by having in mind he is praying the wrong one). An example would be after Shabbat (motzei Shabbat), where one omitted havdala in atah chonen in the first Shemoneh Esrei, and said it in the second. Such actions clearly indicate that the first Shemoneh Esrei was the make-up prayer, and he therefore must say it again.
The Mishneh Berurah writes in the name of the Pri Megadim that we follow the ruling of the Shulchan Aruch (108:1). However, he explains that it is better for one to say that if he is not obligated to pray again (in accordance with the Taz and Magen Avraham) then he is praying a voluntary prayer, thereby covering all possibilities. (Shulchan Aruch HaRav)
One can only make up a missed prayer during the following prayer. For example, if one missed both Shacharit and Mincha, in the evening he prays Arvit, then prays again to make up for Mincha — however Shacharit he can not make up.
The law of making up prayers does not apply to Musaf. Therefore, once the sun sets it can not be made up during the next prayer. Likewise, if one missed Shacharit and prayed Musaf, he can still make up Shacharit during the Mincha prayer.
Someone can make up a missed prayer by saying the repetition as the Shaliach Tzibur for Shacharit or Mincha. (Magen Avraham, Shulchan Aruch HaRav)