But if breaking the oath is better, the Prophet ﷺ said: “By Allah, if Allah wills, I do not swear an oath and then see something else better than it except that I expiate for my oath and do what is better.” (1)
The Prophet ﷺ also said to Abd al-Rahman ibn Samurah: “If you swear an oath and then see something else better than it, expiate for your oath and do what is better.” (2)
Thus, both his statement and his practice ﷺ establish that if breaking the oath is better, then one should do so. The superiority of breaking an oath may sometimes be due to an obligation, and at other times due to a recommended act. If it is better because of an obligation, then breaking the oath becomes obligatory; and if it is better because of a recommended act, then breaking the oath is recommended.
An example of where it is better due to an obligation is if someone says, “By Allah, I will not pray with the congregation today.” He has sworn to abandon an obligation, so breaking the oath here is obligatory. He must pray with the congregation and expiate for his oath.
An example of where it is better due to a recommended act is if someone says, “By Allah, I will not pray the witr prayer.” Here he has sworn concerning something recommended, so breaking the oath is better for him than keeping it. We therefore say to him: Pray witr and expiate for your oath.
Likewise, if a man quarrels stubbornly with his paternal uncle over some matter and says, “By Allah, I will not speak to my uncle,” then he has sworn concerning something that involves shunning a believer and severing ties of kinship,