For Something Sinful —
Narrated Ibn Abbas: While the Prophet, peace be upon him, was delivering a Khutbah, he saw a man standing, so he asked about that man. They said, “it is Abu Israel who has vowed that he will stand and never sit down and he will never come in the shade, nor speak to anybody, [sinful, rejection of Allah’s Blessings] and will fast. The Prophet, peace be upon him, said, “Order him to speak and let him come under the shade and make him sit. But let him complete his fast.”
[8: 695- O.B. Sahih Al-Bukhari)
Fulfilling On Behalf Of Others —
Narrated Sa’id bin Ubadah Al Ansari: That he consulted the Prophet, peace be upon him, about a vow that had been made by his mother, who died without fulfilling it. The Prophet, peace be upon him, gave the verdict that he should fulfill it on her behalf.
[8: 689- O.B. Sahih Al-Bukhari)
How & What To Swear —
Narrated Abdullah bin Omar: The Prophet, peace be upon him, said, “Whoever has to take an oath should swear by Allah or keep quiet.” (I.e. He should not swear by other than Allah.)
[3: 844- O.B. Sahih Al-Bukhari)
Willfully Going Back In Changed Situation —
Narrated Abu Moosa: We, a group of Al-Ash’ariun people went to the Prophet, peace be upon him, and asked him to give something to ride, but the Prophet, peace be upon him, refused. Then we asked him for the second time to give us something to ride, but the Prophet, peace be upon him, took an oath that he would not give us anything to ride. After a while, some camels of booty were brought to the Prophet, peace be upon him, and he ordered that five camels be given to us. When we took those camels, we said, “We have made the Prophet, peace be upon him, forget his oath, so we will never be successful after this.” So I went to the Prophet, peace be upon him, and said, “O Allah’s Messenger! You took an oath that you would not give us anything to ride, but you have given us.” He said, “Yes, for if I take an oath and later I see a better solution than that, I act on the later.” And the Prophet expiated it (that oath).
(5: 668- O.B. Sahih Al-Bukhari)
Narrated Abdur Rahman bin Samura: The Prophet, peace be upon him, said, “… O Abdur Rahman bin Samura! Whenever you take an oath to do something and later you find that something else is better than the first; then do the better one and make expiation of your oath.”
Allah does not take you to task for the inadvertent oaths you swear, but He will surely call you to account for the intentional and deliberate oaths you make. The expiation (of breaking such an oath) is to feed ten indigent persons with the food you normally serve in your own family, or to give them clothes, or to free one slave, and the one who cannot afford any of these, let him fast three days. This is the expiation of breaking the solemn oaths you have taken; be mindful of your oaths. Thus Allah makes His Commandments plain to you so that you may show gratitude. Al-Maidah 5:89]
[8: 619- O.B. Sahih Al-Bukhari)