كتاب الأيمان
27  
The Book of Oaths
(3)
Chapter: It is recommended for the one who swears an oath then sees that something else is better than it; To do that which is better and offer expiation for his oath
(3)
باب نَدْبِ مَنْ حَلَفَ يَمِينًا فَرَأَى غَيْرَهَا خَيْرًا مِنْهَا أَنْ يَأْتِيَ الَّذِي هُوَ خَيْرٌ وَيُكَفِّرَ عَنْ يَمِينِهِ
Sahih Muslim 1649 c

Ayyub said:

We were sitting in the company of Abu Musa that he called for food and it consisted of flesh of fowl. It was then that a person from Banu Tamim visited him. His complexion was red having the resemblance of a slave. He said to him: Come and (join me in food). He showed reluctance. He (Abu Masa) said: Come on, for I saw Allah's Messenger (ﷺ) eating it (fowl's meat), whereupon that person said: I saw it eating something (of filth and rubbish) and I found it repugnant and took an oath that I would never eat that. He (Abu Muds) said: Come, so that I would narrate to you about that (the incident pertaining to vow). (And he narrated thus): I came to Allah's Messenger (ﷺ) along with a group of people belonging to the tribe of Ash'ari, asking him to provide us with riding camels. He (the Holy Prophet) said: By Allah, I cannot provide you with riding animals. And there is nothing with me with which I can provide you a mount. We stayed (for some time) there as Allah willed, and there was brought to Allah's Messenger (ﷺ) booty of camels. He called us and commanded that we should be given five white humped camels. As we were about to go back, some of us said to the other: As we made Allah's Messenger (ﷺ) forget oath, there would be no blessing for us (in his gift). We went back to him and said: Allah's Messenger, we came to you to provide us with riding animals and you took an oath that you would never equip us with mounts and then you have provided us with the riding beasts Allah's Messenger, have you forgotten? Thereupon he said: I swear by Allah that if Allah so wills, I shall not swear an oath, and then consider something else to be better than it without making atonement for my oath and doing the thing that is better. So you go; Allah, the Exalted and Glorious, has given you riding animals.
حَدَّثَنِي أَبُو الرَّبِيعِ الْعَتَكِيُّ، حَدَّثَنَا حَمَّادٌ، - يَعْنِي ابْنَ زَيْدٍ - عَنْ أَيُّوبَ، عَنْ أَبِي، قِلاَبَةَ وَعَنِ الْقَاسِمِ بْنِ عَاصِمٍ، عَنْ زَهْدَمٍ الْجَرْمِيِّ، - قَالَ أَيُّوبُ وَأَنَا لِحَدِيثِ الْقَاسِمِ، أَحْفَظُ مِنِّي لِحَدِيثِ أَبِي قِلاَبَةَ - قَالَ كُنَّا عِنْدَ أَبِي مُوسَى فَدَعَا بِمَائِدَتِهِ وَعَلَيْهَا لَحْمُ دَجَاجٍ فَدَخَلَ رَجُلٌ مِنْ بَنِي تَيْمِ اللَّهِ أَحْمَرُ شَبِيهٌ بِالْمَوَالِي فَقَالَ لَهُ هَلُمَّ ‏.‏ فَتَلَكَّأَ فَقَالَ هَلُمَّ فَإِنِّي قَدْ رَأَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَأْكُلُ مِنْهُ ‏.‏ فَقَالَ الرَّجُلُ إِنِّي رَأَيْتُهُ يَأْكُلُ شَيْئًا فَقَذِرْتُهُ فَحَلَفْتُ أَنْ لاَ أَطْعَمَهُ فَقَالَ هَلُمَّ أُحَدِّثْكَ عَنْ ذَلِكَ إِنِّي أَتَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم فِي رَهْطٍ مِنَ الأَشْعَرِيِّينَ نَسْتَحْمِلُهُ فَقَالَ ‏"‏ وَاللَّهِ لاَ أَحْمِلُكُمْ وَمَا عِنْدِي مَا أَحْمِلُكُمْ عَلَيْهِ ‏"‏ ‏.‏ فَلَبِثْنَا مَا شَاءَ اللَّهُ فَأُتِيَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِنَهْبِ إِبِلٍ فَدَعَا بِنَا فَأَمَرَ لَنَا بِخَمْسِ ذَوْدٍ غُرِّ الذُّرَى قَالَ فَلَمَّا انْطَلَقْنَا قَالَ بَعْضُنَا لِبَعْضٍ أَغْفَلْنَا رَسُولَ اللَّهِ صلى الله عليه وسلم يَمِينَهُ لاَ يُبَارَكُ لَنَا ‏.‏ فَرَجَعْنَا إِلَيْهِ فَقُلْنَا يَا رَسُولَ اللَّهِ إِنَّا أَتَيْنَاكَ نَسْتَحْمِلُكَ وَإِنَّكَ حَلَفْتَ أَنْ لاَ تَحْمِلَنَا ثُمَّ حَمَلْتَنَا أَفَنَسِيتَ يَا رَسُولَ اللَّهِ قَالَ ‏"‏ إِنِّي وَاللَّهِ إِنْ شَاءَ اللَّهُ لاَ أَحْلِفُ عَلَى يَمِينٍ فَأَرَى غَيْرَهَا خَيْرًا مِنْهَا إِلاَّ أَتَيْتُ الَّذِي هُوَ خَيْرٌ وَتَحَلَّلْتُهَا فَانْطَلِقُوا فَإِنَّمَا حَمَلَكُمُ اللَّهُ عَزَّ وَجَلَّ ‏"‏ ‏.‏
Reference : Sahih Muslim 1649c
In-book reference : Book 27, Hadith 12
USC-MSA web (English) reference : Book 15, Hadith 4046
  (deprecated numbering scheme)