סימן קכט סעיף ה
אִם שָׁכַח זָכְרֵנוּ, אוֹ מִי כָּמוֹךָ, וּכְתֹב, בְּסֵפֶר חַיִּים, וְלֹא נִזְכַּר עַד שֶׁאָמַר בָּרוּךְ אַתָּה ה', כֵּיוָן שֶׁאָמַר אֶת הַשֵּׁם, גּוֹמֵר אֶת הַבְּרָכָה וּמִתְפַּלֵּל כַּסֵּדֶר, וְאֵינוֹ צָרִיךְ לַחֲזוֹר. וְכֵן אִם שָׁכַח לוֹמַר וּבְכֵן תֵּן פַּחְדְּךָ וְחָתַם הַמֶּלֶךְ הַקָּדוֹשׁ, וַאֲפִלּוּ לֹא אָמַר עֲדַיִן רַק בָּרוּךְ אַתָּה ה', חוֹתֵם הַמֶּלֶךְ הַקָּדוֹשׁ וְאוֹמֵר אַתָּה בְּחַרְתָּנוּ וְכוּ'.
If you forgot to say Zochreinu [Remember us], or Mi chamocha [Who is like You], or Uchsov [And inscribe], or Beseifer chayim [In the book of life] and you do not become aware of it until you said Baruch ata Hashem, [Blessed are You, Hashem], since you mentioned Hashem, you should conclude the berachah,4However, if you did not yet say the Hashem of the berachah, you may go back and say whatever you omitted. (Ibid 582:15) and continue the Shemoneh Esrei, and you need not repeat it. Similarly, if you forgot to say [the entire section beginning with] Uvechein tein pachdecha [And so, grant that Your awe] and you concluded the berachah, Hamelech hakadosh, even if you only said Baruch ata Hashem, you should conclude Hamelech hakadosh, and then say Ata vechartanu [You have chosen us] etc.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)