Praise be to Allah.
If you swear an oath to your children or anyone else with the aim that they should do something or do not do something, and they go against your wishes, then you have to offer expiation for breaking an oath (kafaarat yameen), because Allaah says (interpretation of the meaning):
“Allaah will not punish you for what is unintentional in your oaths, but He will punish you for your deliberate oaths; for its expiation (a deliberate oath) feed ten Masaakeen (poor persons), on a scale of the average of that with which you feed your own families, or clothe them or manumit a slave. But whosoever cannot afford (that), then he should fast for three days. That is the expiation for the oaths when you have sworn. And protect your oaths (i.e. do not swear much).”
[al-Maa’idah 5:89]
Similarly, if you swear an oath to do something or not to do something, then you realise that it is better to do the opposite, there is nothing wrong with you breaking your oath and offering the expiation mentioned, because the Prophet (blessings and peace of Allaah be upon him) said: “If you swear an oath then decide that something else is better than it, then offer expiation for your oath and do that which is better.” Saheeh – agreed upon. End quote.
Comment