The law if the Olah was shown the wrong text by his Aliyah and it was only discovered after he said the blessing:
The debate: If the Olah was shown the wrong text of the reading in the Sefer Torah and he already recited the blessing, then it is debated amongst the Poskim as to whether his blessing remains valid, or if it must be repeated. Some Poskim rule that his blessing remains valid and is not to be repeated. However, other Poskim rule that the blessing is invalid in such a case and hence he must repeat the blessing after being shown the correct text.
The final ruling and custom: Practically, the Ashkenazi custom is like the latter opinion, to require the blessing to be repeated if one was shown the wrong area of reading. The Olah is thus to say Baruch Sheim Kevod Malchuso Leolam Vaed.
Cases of exception when the blessing is not repeated: 1) The entire law above which requires one to repeat the blessing after being shown the wrong text, only applies if the correct area of text was not at all open before the Olah while he said the before blessing, in which case he must repeat the blessing from the beginning. However, if the correct area of text was open in front of the Olah, even if it was on a different Amud, the blessing is not to be repeated even though he was not shown the correct text. Nonetheless, in such a case, if he was shown an area of the text that is lower than the correct area, then if it is not already part of the next Parsha, the Baal Korei is to continue reading until he passes the shown area. 2) Furthermore, some Poskim rule that the blessing is only to be repeated if one was unaware of the text of that days reading, however, if one was aware of which text needed to be read that day, then the blessing is not to be repeated even if he was shown the wrong text on a different page. 3) Furthermore, if they rolled the Sefer Torah to the correct area during the blessing, it remains valid.
If the Olah was shown the wrong text of the reading in the Sefer Torah and he already recited the blessing, then according to the Ashkenazi custom the blessing is to be repeated, unless any of the following apply, in which case a blessing is not to be recited:
1. The correct area of the text was open in front of him, and he was simply shown a wrong area of the text.
2. The Olah was aware of the correct text for the reading, and simply did not pay attention to what he was shown.
3. The Sefer Torah was rolled to the correct area of the reading while he was still in midst of the blessing.
If the Olah must repeat the new blessing, is he to begin again from Barchu?
Some Poskim rule that he is to repeat Barchu. Other Poskim, however, rule that Barchu is not to be repeated. Practically, if the Chazan already began the reading, then the Olah should start again from Barchu, while if he remembered before beginning the reading then Barchu is not repeated.
 See Michaber 140:3; Shaareiy Efraim 4:18; Ketzos Hashulchan 84:6-8; Piskeiy Teshuvos 140:3
 1st opinion in Michaber ibid; Abudarahm p. 317 in name of Rabbeinu Gershom
 The reason: As his intent in his blessing was on the general verses of Torah, and not on any specific Parsha or verse. [M”A 140:4, in name of Beis Yosef 140, in name of Abudarham; Kaf Hachaim 140:15]
 2nd opinion in Michaber ibid; Abudarahm p. 317 in name of Anshei Hador; Beis Yosef
 The reason: As his intent in his blessing was only on the specific verses of Torah that he was shown, and not on any other Parsha or verse, just as we rule regarding one who said a blessing on a cup of wine, and the wine then spilled, that a new blessing must be recited even if a new cup of wine is brought before him right away. Likewise, the rolling of the Sefer Torah to find the correct place is considered a silent Hefsek, of which the Yerushalmi [Brachos 6:1] rules that it invalidates the blessing. [M”A 140:4, in name of Beis Yosef 140, in name of Abudarham in name of Rabbeinu Gershom; M”B 140:9]
 M”A 140:4; Beir Heiytiv 140:1 in name of M”A, Taz, Mabit, Tikkun Yissachar p. 56; Chayeh Adam 31:30; M”B 140:9 in name of Achronim; Kitzur SHU”A 23:18; Ketzos Hashulchan 84:6
Other opinions and Sephardi custom: Some Poskim rule like the first opinion, that the blessing is not to be repeated, and so is the Sephardi custom. [Sheilas Yaavetz 66; Yifei Laleiv 140:2; Ledavid Emes 6:61; Kaf Hachaim 140:15 as Safek Brachos Lihakel; Yalkut Yosef 140:4; See P”M 140 M”Z 4]
 Kitzur SHU”A ibid
 Taz 140:4 [regarding even if showed different Parsha]; Beir Heiytiv 140:1 in name of Perach Shushan 1, Mabit; Radbaz, Tikkun Yissachar [regarding if is same Parsha]; Shaareiy Efraim 4:17; M”B 140:9; Ketzos Hashulchan 84:6
 Shaareiy Efraim 4:17; M”B 140:9; Ketzos Hashulchan 84:7;
 P”M 140 M”Z 4, brought in Biur Halacha 140:3 “Vehizkiruhu”; Daas Torah 140; Orchos Chaim Spinka 140:3; Minchas Yitzchak 7:7; Igros Moshe 1:36; Orchos Rabbeinu 3:214; Piskeiy Teshuvos ibid that so is custom
Other opinions: Some Poskim rule that the blessing must be repeated even in such a case. [Derech Hachaim 209:2, brought in Biur Halacha 140:3 “Vehizkiruhu”]
 Shaareiy Efraim 4:19; Ketzos Hashulchan 84:8
 Implication of Elya Raba 140:1; P”M 140 A”A 3; Kaf Hachaim 140:5
 M”B 140:3 in name of Elya Raba [however see Kaf Hachaim ibid]; Piskeiy Teshuvos 140:1 and 3
 Shaareiy Efraim 4:18; Ketzos Hashulchan 84:7