Abu Musa Ashari reported,

I came to the Prophet ﷺ with a group from the Asharis to ask him for mounts to ride. He said, "By Allah, I cannot give you mounts, and I have nothing to mount you on."We waited as long as Allah willed, then he was brought three fine camels with white humps, and he had us mounted on them.When we set off, we said, or some of us said, "By Allah, no blessing will come to us. We came to the Prophet ﷺ asking him for mounts, and he swore he would not mount us, then he mounted us. Let us go back to the Prophet ﷺ and remind him of this."So we came to him, and he said, "It was not I who mounted you, rather Allah mounted you. 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," or, "doing what is better and making expiation for my oath."

Bukhari 6623

Sahih

حدثنا أبو النعمان حدثنا حماد بن زيد عن غيلان بن جرير

عن أبي بردة عن أبيه قال

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

البخاري 6623صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Oaths and vows
Chapter
Allah's saying, "Allah will not impose blame upon you for what is meaningless in your oaths, but He will impose blame upon you for oaths you have made binding. So its expiation is the feeding of ten needy people from the Awsat of what you feed your own families or clothing them or the freeing of a Raqaba. But whoever cannot find the means, then a fast of three days. That is the expiation for oaths when you have sworn. And guard your oaths. Thus does Allah make clear to you His verses that you may be grateful."
Numbering
Darussalam 6623
Bukhari 6623