ב לָקַח כּוֹס שֶׁל שֵׁכָר אוֹ מַיִם, וּבֵרַךְ: בָּרוּךְ אַתָּה ה' אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם בּוֹרֵא פְּרִי הַגֶּפֶן, וְתוֹךְ כְּדֵי דִּבּוּר נִזְכַּר שֶׁטָּעָה, וְאָמַר: שֶׁהַכֹּל נִהְיָה בִּדְבָרוֹ, וְכָךְ הָיְתָה אֲמִירָתוֹ: בָּרוּךְ אַתָּה ה' אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם בּוֹרֵא פְּרִי הַגֶּפֶן, שֶׁהַכֹּל נִהְיָה בִּדְבָרוֹ, יָצָא. הַגָּה: וְאִם הָיוּ אֲחֵרִים שׁוֹתִים גַּם כֵּן וְיַיִן לִפְנֵיהֶם וְדַעְתּוֹ גַּם כֵּן עַל יַיִן שֶׁהָיָה סָבוּר שֶׁבְּכוֹסוֹ יַיִן, וּבֵרַךְ בּוֹרֵא פְּרִי הַגֶּפֶן, וְנִמְצָא אַחַר כָּךְ שֶׁבְּכוֹסוֹ מַיִם אוֹ שֵׁכָר, כְּשֶׁחוֹזֵר וְשׁוֹתֶה אַחַר כָּךְ יַיִן אֵינוֹ צָרִיךְ לַחֲזֹר וּלְבָרֵךְ, וְיוֹצֵא בַּבְּרָכָה שֶׁבֵּרַךְ עַל כּוֹסוֹ אַף עַל פִּי שֶׁהָיְתָה בְּטָעוּת, דְּהָא דַּעְתּוֹ הָיָה לִשְׁתּוֹת גַּם כֵּן שְׁאָר יַיִן, גַּם הוֹצִיא הָאֲחֵרִים שֶׁשּׁוֹתִין שָׁם, וְלָכֵן בִּרְכָּתוֹ בְּרָכָה (תְּשׁוּבַת מַהֲרִי"ל סי' צ"ב ב"י ססי' ר"ו).
2 He took a cup of alcohol or water and blessed, “Blessed are You, Lord our God, King of the universe, Who created the fruit of the vine” (Bore Pri Hagafen), and during the blessing he remembered that he had made a mistake and he said שהכל. Since his wording was “Blessed are You, Lord our God, King of the universe, Who created the fruit of the vine, שהכל” he fulfilled his obligation. Rema: if others were also drinking and they had wine before them, and his intention was also on wine, thinking that in his cup there was wine, and he blessed Bore Pri Hagafen, but afterward it turned out that in his cup there was water or alcohol, and then afterward he drank wine, there is no need to bless again, and he fulfills the blessing he made over his cup, even though it was a mistake, for his intention was to drink other wine also that others were drinking there. Therefore his blessing is considered valid. (Responsa Maharil, section 92; Be’er Yosef, section 216)