(1) بَابُ قَوْلُ اللَّهِ تَعَالَى: {لاَ يُؤَاخِذُكُمُ اللَّهُ بِاللَّغْوِ فِي أَيْمَانِكُمْ وَلَكِنْ يُؤَاخِذُكُمْ بِمَا عَقَّدْتُمُ الأَيْمَانَ فَكَفَّارَتُهُ إِطْعَامُ عَشَرَةِ مَسَاكِينَ مِنْ أَوْسَطِ مَا تُطْعِمُونَ أَهْلِيكُمْ أَوْ كِسْوَتُهُمْ أَوْ تَحْرِيرُ رَقَبَةٍ فَمَنْ لَمْ يَجِدْ فَصِيَامُ ثَلاَثَةِ أَيَّامٍ ذَلِكَ كَفَّارَةُ أَيْمَانِكُمْ إِذَا حَلَفْتُمْ وَاحْفَظُوا أَيْمَانَكُمْ كَذَلِكَ يُبَيِّنُ اللَّهُ لَكُمْ آيَاتِهِ لَعَلَّكُمْ تَشْكُرُونَ}
Narrated Abu Musa:
I went to the Prophet (ﷺ) along with a group of Al-Ash`ariyin in order to request him to provide us with mounts. He said, "By Allah, I will not provide you with mounts and I haven't got anything to mount you on." Then we stayed there as long as Allah wished us to stay, and then three very nice looking she-camels were brought to him and he made us ride them. When we left, we, or some of us, said, "By Allah, we will not be blessed, as we came to the Prophet (ﷺ) asking him for mounts, and he swore that he would not give us any mounts but then he did give us. So let us go back to the Prophet (ﷺ) and remind him (of his oath)." When we returned to him (and reminded him of the fact), he said, "I did not give you mounts, but it is Allah Who gave you. By Allah, Allah willing, if I ever take an oath to do something and then I find something else than the first, I will make expiation for my oath and do the thing which is better (or do something which is better and give the expiation for my oath).
Reference: Sahih al-Bukhari 6623
In-book reference: Book 83, Hadith 3
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 8, Book 78, Hadith 620