Hadrat Abu Hurayrah (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Whoever swears an oath about something and something else is better than it, let him give the expiation for his oath and do the good thing."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19961