It is narrated from Ibn Musayyib that Ali bin Abi Talib (may Allah be pleased with him) said: When a man divorces his wife, he has more right to take her back until she performs ghusl after her third menstruation. This right of taking her back applies in the case of the first and second divorce.
Hadith Referenceمسند الإمام الشافعي / كتاب الرجعة / 1283
Hadith Takhrijاسناده صحیح اخرجه البيهقي : 417/7 - وفى المعرفة السنن والآثار له (4613) - وعبدالرزاق (10983)، (10984) وابن ابي شيبة (18894)۔