All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Marriage and divorce are matters governed by the law of Allah, and it is not permissible to play with them or use them as a trick or means to obtain worldly gains. As the Messenger of Allah, peace be upon him, said: "There are three things which, whether undertaken seriously or in jest, are treated as serious: marriage, divorce and taking back a wife after a divorce which is not final." [Abu Dawud].
It is stated in the book [Tohfat Al-Ahwathi, vol.4/pp.304]: "And jest means intending something other than what the word is used for, without a suitable connection between them. Seriousness means intending what the word is used for or what the word can metaphorically refer to. ... Meaning, if someone divorces, marries, or takes back a wife after a divorce which isn`t final and then says, 'I was only joking,' it will not benefit them. Al-Khadi said: Scholars have unanimously agreed that the divorce of a jesting person is valid. So, if the explicit word of divorce is uttered by a sane adult, it will not benefit them to say, 'I was joking,' because if this were accepted from them, then Sharia rulings would be rendered ineffective. Moreover, if every person who divorces or marries says: "I was joking in my statement, then this would result in the nullification of Allah's rulings."
In addition, if a divorce occurs in the presence of a judge and it is a revocable divorce (Bainuna Sugra), then the woman becomes prohibited to her husband and is only lawful to him after a new contract, a new dowry, and with her consent. However, if the divorce is irrevocable (Bainuna Kubra), she is only lawful to him if she marries another man, who then divorces her or dies, and after she has completed the waiting period (Iddah).
In conclusion, we must emphasize here the necessity of informing the wife that it is not permissible for her to return to her husband except through a new contract. The husband does not have the authority to take her back, neither by words nor by actions. And Allah The Almighty Knows Best.