We proceeded with the Messenger of Allah ﷺ on the occasion of al-Hudaybiyyah. The Messenger of Allah ﷺ said: Who will keep watch for us? Bilal said: I (shall do). The overslept till the sun arose. The Prophet ﷺ awoke and said: Do as you used to do (i.e. offer prayer as usual). Then we did accordingly. He said: Anyone who oversleeps or forgets (prayer) should do similarly.
أَقْبَلْنَا مَعَ رَسُولِ اللَّهِ ﷺ زَمَنَ الْحُدَيْبِيَةِ فَقَالَ رَسُولُ اللَّهِ ﷺ مَنْ يَكْلَؤُنَا فَقَالَ بِلاَلٌ أَنَا فَنَامُوا حَتَّى طَلَعَتِ الشَّمْسُ فَاسْتَيْقَظَ النَّبِيُّ ﷺ فَقَالَ افْعَلُوا كَمَا كُنْتُمْ تَفْعَلُونَ قَالَ فَفَعَلْنَا قَالَ فَكَذَلِكَ فَافْعَلُوا لِمَنْ نَامَ أَوْ نَسِيَ