Allah's Statement: "Allah will not punish you for what is unintentional in your oaths..." (V.5:89)
Narrated Aisha:That her father (Abu Bakr) never broke his oath till Allah revealed the order of the legal expiation for oath. Abu Bakr said, "If I ever take an oath (to do something) and later find that to do something else is better, then I accept Allah's permission and do that which is better, (and do the legal expiation for my oath ) ".
Reference
Sahih al-Bukhari 4614
In-book reference
Book 65, Hadith 136
USC-MSA web (English)
Vol. 6, Book 60, Hadith 138
Translation by Dr. M. Muhsin Khan · Language: EN
Sahih
Arabic Text
حَدَّثَنَا أَحْمَدُ بْنُ أَبِي رَجَاءٍ، حَدَّثَنَا النَّضْرُ، عَنْ هِشَامٍ، قَالَ أَخْبَرَنِي أَبِي، عَنْ عَائِشَةَ ـ رضى الله عنها ـ أَنَّ أَبَاهَا، كَانَ لاَ يَحْنَثُ فِي يَمِينٍ حَتَّى أَنْزَلَ اللَّهُ كَفَّارَةَ الْيَمِينِ. قَالَ أَبُو بَكْرٍ لاَ أَرَى يَمِينًا أُرَى غَيْرَهَا خَيْرًا مِنْهَا، إِلاَّ قَبِلْتُ رُخْصَةَ اللَّهِ، وَفَعَلْتُ الَّذِي هُوَ خَيْرٌ.