حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا حَمَّادٌ، حَدَّثَنَا غَيْلاَنُ بْنُ جَرِيرٍ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِيهِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏:‏ ‏"‏ إِنِّي وَاللَّهِ إِنْ شَاءَ اللَّهُ لاَ أَحْلِفُ عَلَى يَمِينٍ فَأَرَى غَيْرَهَا خَيْرًا مِنْهَا إِلاَّ كَفَّرْتُ عَنْ يَمِينِي، وَأَتَيْتُ الَّذِي هُوَ خَيْرٌ ‏"‏ ‏.‏ أَوْ قَالَ ‏:‏ ‏"‏ إِلاَّ أَتَيْتُ الَّذِي هُوَ خَيْرٌ وَكَفَّرْتُ يَمِينِي ‏"‏ ‏.‏
Translation
A similar tradition has been transmitted by 'Abd al-Rahman b. Samurah through a different chain if narrators. This version has

Abu Dawud said: The version of this tradition transmitted by Abu Musa al-Ash'ari, 'Adi b. Hatim and Abu Hurairah are variant. Some of them indicate breaking the oath before making atonement, and other making atonement before breaking the oath.