كتاب الأيمان
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 1652 a

Abd al-Rahman b. Samura reported that Allah's Messenger (ﷺ) said to me:

Abd al-Rahman b. Samura, don't ask for authority for if it is granted to you for asking for it, you would be commissioned for it (without having the support of Allah), but if you are granted it without your asking for it. You would be helped (by Allah) in it. And when you take an oath and find something else better than that, expiate for (breaking) your oath, and do that which is better. This hadith has also been transmitted on the authority of Ibn Farrukh.

The above hadith is narratted through another chain of transmitters.

حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا جَرِيرُ بْنُ حَازِمٍ، حَدَّثَنَا الْحَسَنُ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ، بْنُ سَمُرَةَ قَالَ قَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ يَا عَبْدَ الرَّحْمَنِ بْنَ سَمُرَةَ لاَ تَسْأَلِ الإِمَارَةَ فَإِنَّكَ إِنْ أُعْطِيتَهَا عَنْ مَسْأَلَةٍ وُكِلْتَ إِلَيْهَا وَإِنْ أُعْطِيتَهَا عَنْ غَيْرِ مَسْأَلَةٍ أُعِنْتَ عَلَيْهَا وَإِذَا حَلَفْتَ عَلَى يَمِينٍ فَرَأَيْتَ غَيْرَهَا خَيْرًا مِنْهَا فَكَفِّرْ عَنْ يَمِينِكَ وَائْتِ الَّذِي هُوَ خَيْرٌ ‏"‏ ‏.‏

قَالَ أَبُو أَحْمَدَ الْجُلُودِيُّ حَدَّثَنَا أَبُو الْعَبَّاسِ الْمَاسَرْجَسِيُّ، حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، ‏.‏ بِهَذَا الْحَدِيثِ ‏.‏

Reference : Sahih Muslim 1652a
In-book reference : Book 27, Hadith 28
USC-MSA web (English) reference : Book 15, Hadith 4062
  (deprecated numbering scheme)