It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When you swear an oath about something, and then something else is better than it, give the expiation for your oath and do that better thing."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19962