Sunan Abi Dawud, Hadith 3270

Narrated Abu Burdah: On the authority of his father that the Prophet said: I swear by Allah that if Allah wills I shall swear on an oath and then consider something else to be better than it without making atonement for my oath and doing the thing that is better. Or he said (according to another version): But doing the thing that is better and making atonement for my oath.

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا حَمَّادٌ، حَدَّثَنَا غَيْلاَنُ بْنُ جَرِيرٍ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِيهِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏:‏ ‏"‏ إِنِّي وَاللَّهِ إِنْ شَاءَ اللَّهُ لاَ أَحْلِفُ عَلَى يَمِينٍ فَأَرَى غَيْرَهَا خَيْرًا مِنْهَا إِلاَّ كَفَّرْتُ عَنْ يَمِينِي، وَأَتَيْتُ الَّذِي هُوَ خَيْرٌ ‏"‏ ‏.‏ أَوْ قَالَ ‏:‏ ‏"‏ إِلاَّ أَتَيْتُ الَّذِي هُوَ خَيْرٌ وَكَفَّرْتُ يَمِينِي ‏"‏ ‏.‏

sunnah.com

also referenced under: Hadith 3276 (DarusSalam)