[Machine] The Messenger of Allah, ﷺ , said: "If one of you becomes distracted during prayer, they should withdraw and perform ablution again and redo their prayer." This allows for the repetition of the prayer and it is also narrated by Al-Miswar ibn Makhrama from the companions.
قَالَ رَسُولُ اللهِ ﷺ إِذَا فَسَا أَحَدُكُمْ فِي الصَّلَاةِ فَلْيَنْصَرِفْ فَلْيَتَوَضَّأْ وَلْيُعِدْ صَلَاتَهُ وَهَذَا يُصَرِّحُ بِإِعَادَةِ الصَّلَاةِ وَبِهِ قَالَ الْمِسْوَرُ بْنُ مَخْرَمَةَ مِنَ الصَّحَابَةِ