Abu Saeed Khudri reported,

Two men set out on a journey. When the time for prayer came, they had no water with them, so they performed tayammum with clean earth and prayed. Then they found water while the time of 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 did not repeat the prayer, "You followed the Sunnah, and your prayer suffices you."To the one who performed ablution and repeated the prayer, he said, "For you is the reward twice over."

Azami 1723

Sahih

عن أبي سعيد الخدري قال

خرج رجلان في سفر، فحضرت الصلاة وليس معهما ماء، فتيمما صعيدا طيبا فصليا، ثم وجدا الماء في الوقت، فأعاد أحدهما الصلاة والوضوء، ولم يعد الآخر، ثم أتيا رسول الله ﷺ ذكرا ذلك له، فقال للذي لم يعد: أصبت السنة وأجزأت صلاتك. وقال للذي توضأ وأعاد: لك الأجر مرتين.

الأعظمي 1723صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tayammum
Section
One performing tayammum finds water after praying within the time
Numbering
Jami al-Kamil 1723 (2nd edition)
Azami 1723