Sahih Muslim Book 15, Hadith Number 4046.

Chapter : It is excellent to break the vow if one finds it better doing that which is against this vow one should expiate it.

Ayyub said: We were sitting in the company of Abu Musa that he called for food and it consisted of flesh of fowl. It was then that a person from Banu Tamim visited him. His complexion was red having the resemblance of a slave. He said to him: Come and (join me in food). He showed reluctance. He (Abu Masa) said: Come on, for I saw Allah’s Messenger (may peace be upon him) eating it (fowl’s meat), whereupon that person said: I saw it eating something (of filth and rubbish) and I found it repugnant and took an oath that I would never eat that. He (Abu Muds) said: Come, so that I would narrate to you about that (the incident pertaining to vow). (And he narrated thus): I came to Allah’s Messenger (may peace be upon him) along with a group of people belonging to the tribe of Ash’ari, asking him to provide us with riding camels. He (the Holy Prophet) said: By Allah, I cannot provide you with riding animals. And there is nothing with me with which I can provide you a mount. We stayed (for some time) there as Allah willed, and there was brought to Allah’s Messenger (may peace be upon him) booty of camels. He called us and commanded that we should be given five white humped camels. As we were about to go back, some of us said to the other: As we made Allah’s Messenger (may peace be upon him) forget oath, there would be no blessing for us (in his gift). We went back to him and said: Allah’s Messenger, we came to you to provide us with riding animals and you took an oath that you would never equip us with mounts and then you have provided us with the riding beasts Allah’s Messenger, have you forgotten? Thereupon he said: I swear by Allah that if Allah so wills, I shall not swear 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. So you go; Allah, the Exalted and Glorious, has given you riding animals.