Abu Musa Ashari reported,

I came to the Messenger of Allah ﷺ with a group of the Ashari clan, asking him to provide us with mounts. He said, "By Allah, I will not provide you with mounts. I have nothing to give you to ride."We waited for as long as Allah willed, and then some camels were brought to him. He ordered that three fine she-camels be given to us. As we set off, we said to one another, "Allah will not bless this for us. We came to the Messenger of Allah ﷺ asking him for mounts, and he swore that he would not provide us any, yet now he has."Abu Musa said, So we returned to the Prophet ﷺ and mentioned this to him. He said, "It was not I who provided you with mounts, rather it was Allah who provided them. By Allah, if Allah wills, I never take an oath and then see something better than it without making expiation for my oath and doing what is better."

Bukhari 6718

Sahih

حدثنا قتيبة بن سعيد حدثنا حماد عن غيلان بن جرير عن أبي بردة بن أبي موسى

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

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

البخاري 6718صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expiations for oaths
Chapter
Exception in oaths
Numbering
Darussalam 6718
Bukhari 6718