It was narrated from 'Amr bin Shu'aib, from his father, that his grandfather said that the Prophet (ﷺ) said:
"Whoever swears an oath then sees that something else is better than it, let him not do it, and his leaving it is the expiation for it. " (RU)
English reference (RU): Vol. 3, Book 11, Hadith 2111 (RU)
Arabic reference (RU): Book 11, Hadith 2189 (RU)