Abu Musa Ashari reported,

I came to the Messenger of Allah ﷺ with a group of the Asharis asking him to provide us with mounts. The Messenger of Allah ﷺ said, "By Allah, I cannot give you mounts, and I have nothing to mount you upon."We waited as long as Allah willed, then some camels were brought to him, and he ordered that three fine camels with white humps be given to us. When we set off, some of us said to one another, "We came to the Messenger of Allah ﷺ asking him for mounts, and he swore that he would not give us any, then he gave us mounts. Let us go back to him."So we came to him and said, "Messenger of Allah, we came to you asking for mounts, and you swore you would not give us any, but then you gave us mounts."He replied, "By Allah, it was not I who gave you mounts, rather it was Allah who gave you mounts. By Allah, if Allah wills, I never make an oath and then see something better than it without making expiation for my oath and doing what is better," or he said, "doing what is better and making expiation for my oath."

Ibn Majah 2107

Sahih

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

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

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

ابن ماجه 2107صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Expiations
Chapter
Whoever swore an oath then saw something better than it
Numbering
Darussalam 2107
Ibn Majah 2107