It is narrated from Sayyiduna Adi bin Hatim (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you swears an oath about something and then sees something better than it, let him make expiation for it and do what is better."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14302