Imran bin Husain (may Allah be pleased with him) narrates that the Prophet (ﷺ) ordered a person in the state of janabah to perform tayammum, then offer prayer, and when water becomes available, he should perform ghusl. In the narration from Abu Dharr (may Allah be pleased with him), it is stated: "When you find water, then perform ghusl with it."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 92
Hadith Takhrijصحيح من غير هذا الوجه ..... اخرجه البخارى، التيمم، باب الصعيد الطيب وضوء المسلم يكفيه عن الماء (344) ومسلم، المساجد، باب قضاء الصلاة الفائتة واستحباب تعجيل قضائها (682).