Sahih Bukhari Volume 8, Book 78, Hadith Number 620.
Narated By 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).”