Two men set out on a journey. The time for prayer came and they had no water with them, so they performed tayammum with clean earth and prayed. Then they found water while the time of the prayer was still in. One of them repeated the ablution and the prayer, while the other did not. They later came to the Messenger of Allah ﷺ and mentioned what had happened.He said to the one who had not repeated the prayer, "You followed the sunnah, and your prayer is sufficient for you."To the one who had performed ablution and repeated the prayer, he said, "You have a double reward."
حدثنا محمد بن إسحق المسيبي أخبرنا عبد الله بن نافع عن الليث بن سعد عن بكر بن سوادة عن عطاء بن يسار
خرج رجلان في سفر فحضرت الصلاة وليس معهما ماء فتيمما صعيدا طيبا فصليا ثم وجدا الماء في الوقت فأعاد أحدهما الصلاة والوضوء ولم يعد الآخر ثم أتيا رسول الله ﷺ فذكرا ذلك له فقال للذي لم يعد أصبت السنة وأجزأتك صلاتك وقال للذي توضأ وأعاد لك الأجر مرتين
[Its isnad is hasan]. Nasai narrated it in ghusl and tayammum, chapter on tayammum for one who finds water after the prayer, hadith 433, from the narration of Ibn Nafi. Hakim graded it sahih according to the standard of the two Shaikhs (1/178), and Dhahabi agreed with him.