Sahih al-Bukhari, Hadith 4385

Narrated Zahdam: When Abu Musa arrived (at Kufa as a governor) he honored this family of Jarm (by paying them a visit). I was sitting near to him, and he was eating chicken as his lunch, and there was a man sitting amongst the people. Abu Musa invited the man to the lunch, but the latter said, "I saw chickens (eating something (dirty) so I consider them unclean." Abu Musa said, "Come on! I saw the Prophet eating it (i.e. chicken)." The man said "I have taken an oath that I will not ea (chicken)" Abu Musa said." Come on! I will tell you about your oath. We, a group of Al-Ash`ariyin people went to the Prophet and asked him to give us something to ride, but the Prophet refused. Then we asked him for the second time to give us something to ride, but the Prophet took an oath that he would not give us anything to ride. After a while, some camels of booty were brought to the Prophet and he ordered that five camels be given to us. When we took those camels we said, "We have made the Prophet forget his oath, and we will not be successful after that." So I went to the Prophet and said, "O Allah' Apostle ! You took an oath that you would not give us anything to ride, but you have given us." He said, "Yes, for if I take an oath and later I see a better solution than that, I act on the later (and gave the expiation of that oaths"

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

sunnah.com