ENOfficial
'Amr bin Shu'aib narrated from his father, from his grandfather, that the Messenger of Allah (ﷺ) said: "Whoever swears an oath, then sees something better than it, let him do that which is better."
Source: sunnah.com
Other translations
Arabic
أَخْبَرَنَا عَمْرُو بْنُ عَلِيٍّ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ عُبَيْدِ اللَّهِ بْنِ الأَخْنَسِ، قَالَ حَدَّثَنَا عَمْرُو بْنُ شُعَيْبٍ، عَنْ أَبِيهِ، عَنْ جَدِّهِ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " مَنْ حَلَفَ عَلَى يَمِينٍ فَرَأَى غَيْرَهَا خَيْرًا مِنْهَا فَلْيُكَفِّرْ عَنْ يَمِينِهِ وَلْيَأْتِ الَّذِي هُوَ خَيْرٌ " .
sunnah.com