Adi bin Hatim reported,

A man came to him asking for a hundred dirhams. He said, "You ask me for a hundred dirhams when I am the son of Hatim? By Allah, I will not give you anything!"Then he said, "Were it not that I heard the Messenger of Allah ﷺ say, 'Whoever swears an oath and then sees something better than it, let him do that which is better.'"

Muslim 4279

Sahih

حدثنا محمد بن المثنى وابن بشار قالا حدثنا محمد بن جعفر حدثنا شعبة عن سماك بن حرب عن تميم بن طرفة قال

سمعت عدي بن حاتم

وأتاه رجل يسأله مائة درهم فقال تسألني مائة درهم وأنا ابن حاتم والله لا أعطيك ثم قال لولا أني سمعت رسول الله ﷺ يقول من حلف على يمين ثم رأى خيرا منها فليأت الذي هو خير

مسلم 4279صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Oaths
Chapter
Recommendation for one who swore an oath then saw something better to do what is better and expiate for his oath
Numbering
Darussalam 4279
Muslim 4279