Tashbetz Katan Siman 230
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
אדם שהתפלל פעם אחת שמונה עשרה ומתפלל פעם אחרת ונזכר בתוך התפלה שהתפלל כבר. אין צריך להשלים תפלתו ופוסק אפילו באמצע ברכה: