Sahih Muslim 1651 e
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
مَنْ حَلَفَ عَلَى يَمِينٍ ثُمَّ رَأَى خَيْرًا مِنْهَا فَلْيَأْتِ الَّذِي هُوَ خَيْرٌ "
Tamim b. Tarafa reported that he heard 'Adi b. Hatim say that a person came to him and asked for one hundred dirhams. He ('Adi) said:
You asked me for one hundred dirhams and I am the son of Hatim; by Allah, I will not give you. But then he said: (I would have done that) if I had not heard Allah's Messenger (ﷺ) say: He who takes an oath, but then finds something better than that, should do that which is better.
Full reference and source
Sahih Muslim 1651 e In-book : Book 27, Hadith 26 USC-MSA web (English) : Book 15, Hadith 4060 (deprecated)
View source on Sunnah.com (opens in a new tab)