Source: Fatawa Aman Puri by Sheikh Ghulam Mustafa Zahir Aman Puri
Question:
What is the ruling if someone gives a divorce in jest?
Answer:
A divorce given in jest is valid, therefore one divorce has taken place, and the husband can return during the waiting period.
❀ Sayyidina Abu Huraira (may Allah be pleased with him) reports that the Messenger of Allah (peace be upon him) said:
"The reality of three things is indeed a reality, and their jest is also a reality: marriage, divorce, and returning (to the wife)."
Reference: (Sunan Abu Dawood: 2194, Sunan al-Tirmidhi: 1225, Sunan Ibn Majah: 2039, Sharh Ma'ani al-Athar by al-Tahawi: 58/2, Sunan al-Daraqutni: 256/3, and its chain is good)