My wife left the house to my cousin's and I asked her to return but she refused. So I said to her, "I will declare you divorced if you do not return home and I will beat you when you come back". I did not take that oath intending to divorce her but to beat her and in fact she returned home that same night.
What is the ruling on this matter?
If the reality is as you mentioned, and you have beaten your wife in order to fulfill your oath, there is no harm on you. Likewise, if you did not fix a certain time for her to return home and you have not beaten her, but you meant to (Part No. 20; Page No. 180) threaten her to come back, and indeed she returned, then there is no harm on you. However, if you had meant that she should return home at the time you pronounced your oath, and she had not come back, then you must make Kaffarah (expiation) for an oath whether by feeding ten poor people or clothing them, or freeing a slave. If you cannot afford any of that, you should fast three - preferably consecutive - days. In addition, you should perform Tawbah (repentance to Allah), as it is not permissible for a Muslim to swear by Talaq (divorce pronounced by a husband) or by any creature, rather one should swear only by Allah. The Prophet (peace be upon him) said,
"If someone has to take an oath, they should swear by Allah or be silent."
(Agreed upon by Al-Bukhari and Muslim)
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.