Sahih Muslim Book 27, Hadith 26
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.