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: "Whoever swears an oath and then sees something better than it, let him abandon his oath and do what is better, and make expiation for his oath."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14304