Abu Burdah (may Allah have mercy on him) narrates from Sayyiduna Abu Musa al-Ash'ari (may Allah be pleased with him) that he said: I came to the Prophet (peace and blessings be upon him) with a group of the Ash'aris seeking mounts. He (peace and blessings be upon him) said: "By Allah! I will not give you mounts, nor do I have any." We stayed with him (peace and blessings be upon him) as long as Allah willed. Then camels were brought to him (peace and blessings be upon him), and he (peace and blessings be upon him) gave us three camels with white humps. When we set off, we said, or some of us said: May Allah not bless us! We asked the Prophet (peace and blessings be upon him) for mounts, but he (peace and blessings be upon him) swore that he would not give them, and then he (peace and blessings be upon him) provided mounts after all. They came and informed the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Allah has given you mounts; I did not give them." He (peace and blessings be upon him) went on to say: "If I swear an oath about something and something else is better than it, I break my oath and do the better thing, and give the expiation for the oath."
(b) Hammad was in doubt whether he (peace and blessings be upon him) said: "I give the expiation for my oath and then do the better thing," or said: "I do the better thing and give the expiation for my oath."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19950