Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) that he (peace and blessings be upon him) said: "Whoever swears an oath and then sees something better than it, his doing the better thing is itself the expiation for his oath."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19860