If a person swears an oath to do something and then sees something better, he should do the better thing and expiate his oath
➊ It is narrated from Abd al-Rahman ibn Samurah (may Allah be pleased with him) that the Messenger of Allah ﷺ said:
إذا حلفت على يمين فرأيت غيرها خيرا منها فأت الذى هو خير و كفر عن يمينك ، وفي لفظ ، فكفر عن يمينك وأت الذى هو خير
“When you swear an oath to do something and then see something else as better than it, do the better thing and expiate your oath.”
And in one narration the words are: “Expiate your oath and do the better thing.”
[Bukhari: 6622, Kitab al-Aiman wa al-Nudhur: Chapter on the saying of Allah: Allah will not take you to task for what is unintentional in your oaths, Ahmad: 62/5, Darimi: 186/2, Abu Dawud: 3278, Nasa’i: 10/7, Bayhaqi: 52/10, Musnad Tayalisi: 1351]
(Abu Hanifa, may Allah have mercy on him) It is not permissible to pay the expiation before breaking the oath.
(Shafi’i, may Allah have mercy on him) Doing so is also permissible.
[Subul al-Salam: 1882/4, al-Rawdah al-Nadiyyah: 361/2, Qafw al-Athar: 1683/5]
(The preponderant view) The position of Imam Shafi’i (may Allah have mercy on him) is the preponderant one, as the previous hadith mentions both cases, and Imam Bukhari (may Allah have mercy on him) established this chapter heading:
الكفارة قبل الحنث و بعده
“Paying the expiation before and after breaking the oath.”