Sahih Muslim , Book 15, Hadith 4052 (USC-MSA) ⓘ
Abu Huraira reported: A person sat late in the night with Allah's Apostle, and then came to his family and found that his children had gone to sleep. His wife brought food for him. but he took an oath that he would not eat because of his children (having gone to sleep without food) He then gave precedence (of breaking the vow and then expiating it) and ate the food He then came to Allah s Messenger and made mention of that to him, whereupon Allah's Messenger (may peace he upon him) said: He who took an oath and (later on) found something better than that should do that, and expiate for (breaking) his vow.
حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا مَرْوَانُ بْنُ مُعَاوِيَةَ الْفَزَارِيُّ، أَخْبَرَنَا يَزِيدُ بْنُ كَيْسَانَ، عَنْ أَبِي حَازِمٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ أَعْتَمَ رَجُلٌ عِنْدَ النَّبِيِّ صلى الله عليه وسلم ثُمَّ رَجَعَ إِلَى أَهْلِهِ فَوَجَدَ الصِّبْيَةَ قَدْ نَامُوا فَأَتَاهُ أَهْلُهُ بِطَعَامِهِ فَحَلَفَ لاَ يَأْكُلُ مِنْ أَجْلِ صِبْيَتِهِ ثُمَّ بَدَا لَهُ فَأَكَلَ فَأَتَى رَسُولَ اللَّهِ صلى الله عليه وسلم فَذَكَرَ ذَلِكَ لَهُ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مَنْ حَلَفَ عَلَى يَمِينٍ فَرَأَى غَيْرَهَا خَيْرًا مِنْهَا فَلْيَأْتِهَا وَلْيُكَفِّرْ عَنْ يَمِينِهِ " .
also referenced under: Book 27, Hadith 18 (In-Book) & Hadith 1650 (Reference)