ENOfficial
It was narrated that 'Adiyy bin Hatim said: "The Messenger of Allah (ﷺ) said: 'Whoever swears an oath, then sees something better than it, let him do that which is better and leave his oath.'"
Source: sunnah.com
Other translations
Arabic
أَخْبَرَنَا عَمْرُو بْنُ يَزِيدَ، قَالَ حَدَّثَنَا بَهْزُ بْنُ أَسَدٍ، قَالَ حَدَّثَنَا شُعْبَةُ، قَالَ أَخْبَرَنِي عَبْدُ الْعَزِيزِ بْنُ رُفَيْعٍ، قَالَ سَمِعْتُ تَمِيمَ بْنَ طَرَفَةَ، يُحَدِّثُ عَنْ عَدِيِّ بْنِ حَاتِمٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مَنْ حَلَفَ عَلَى يَمِينٍ فَرَأَى خَيْرًا مِنْهَا فَلْيَأْتِ الَّذِي هُوَ خَيْرٌ وَلْيَتْرُكْ يَمِينَهُ " .
sunnah.com