Abu Burdah, the son of Abu Musa al-Ash'ari (may Allah be pleased with him), narrates from his father that the Prophet (peace and blessings be upon him) said: "Whenever I swear an oath about something and something else is better, I give the expiation for my oath and do the better thing."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19846