The Prophet ﷺ said, "Whoever swears an oath and then sees something better than it, let him do that which is better."
حدثنا يحيى عن شعبة حدثني سماك عن تميم بن طرفة
عن النبي ﷺ من حلف على يمين فرأى خيرا منها فليأت بالذي هو خير
Its isnad is sahih. Tamim bin Tarafa Tai is one of the reliable Followers, and his hadith is found in Muslim. This hadith previously appeared at 11667.