A man became distressed in the presence of the Prophet ﷺ, then returned to his family and found that the children had gone to sleep. His wife brought him his food, but he swore an oath not to eat because of his children. Then he reconsidered and ate. He came to the Messenger of Allah ﷺ and mentioned this to him.The Messenger of Allah ﷺ said, "Whoever swears an oath, then sees that something else is better than it, let him do what is better and make expiation for his oath."
اغتم رجل عند النبي ﷺ ثم رجع إلى أهله فوجد الصبية قد ناموا، فأتاه أهله بطعامه، فحلف لا يأكل من أجل صبيته، ثم بدا له فأكل. فأتى رسول الله ﷺ فذكر ذلك له. فقال رسول الله ﷺ: من حلف على يمين فرأى غيرها خيرا منها فليأتها، وليكفر عن يمينه.
Muslim narrated it in the book of Oaths and Vows (11:1650) from Zuhayr bin Harb, who said, Marwan bin Muawiya Fazari narrated to us, Yazid bin Kaysan informed us, from Abu Hazim, from Abu Hurairah, who then related it.As for what Ibn Hibban (4353) and Hakim (4/301) narrated, both of them from the hadith of Muhammad bin Abdul-Rahman Tufawi, from Hisham bin Urwa, from his father, from Ayesha, who said, "The Messenger of Allah ﷺ, whenever he swore an oath, would not break it, until the verse on the expiation for oaths was revealed. Then he said, 'I never swear an oath and then see something better than it, without doing what is better and making expiation for my oath.'" This is an error, even though Hakim said, "sahih according to the standard of the two Shaykhs."Tirmidhi said in Ilal al-Kabir (2/654), "I asked Muhammad about the hadith of Tufawi, and he said, 'The hadith of Tufawi is an error. The correct version is from Hisham bin Urwa, from his father, from Ayesha, who said, "Abu Bakr used to..."'" and he went on to relate his statement. He is referring to what he himself narrated in his Sahih (6621) from Muhammad bin Muqatil.