Abu Musa Ashari reported,

We came to the Messenger of Allah ﷺ asking him to provide us with mounts. He said, "I have nothing to give you as mounts. By Allah, I cannot provide you with mounts."Then the Messenger of Allah ﷺ sent us three camels with white humps. We said, "We came to the Messenger of Allah ﷺ asking him for mounts, and he swore that he would not provide us with any."So we went to him and told him this. He said, "I never swear an oath and then see something better than it without doing the better thing."

Muslim 4269

Sahih

و حدثنا إسحق بن إبراهيم أخبرنا جرير عن سليمان التيمي عن ضريب بن نقير القيسي عن زهدم

عن أبي موسى الأشعري قال

أتينا رسول الله ﷺ نستحمله فقال ما عندي ما أحملكم والله ما أحملكم ثم بعث إلينا رسول الله ﷺ بثلاثة ذود بقع الذرى فقلنا إنا أتينا رسول الله ﷺ نستحمله فحلف أن لا يحملنا فأتيناه فأخبرناه فقال إني لا أحلف على يمين أرى غيرها خيرا منها إلا أتيت الذي هو خير

مسلم 4269صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Oaths
Chapter
Recommendation for one who swore an oath then saw something better to do what is better and expiate for his oath
Numbering
Darussalam 4269
Muslim 4269