Muhammad bin al-Hanafiyyah narrates from Sayyiduna Ali (may Allah be pleased with him) concerning a man who gave his wife one or two divorces, then she married another husband, who also divorced her, then she came back to the first husband: after (her) marriage (to another), he begins the divorces anew; but if he married her during her iddah, she will remain with him on the basis of the remaining divorces.
The first narration from Ali (may Allah be pleased with him) is more authentic, and the narrations of Abd al-A'la from Ibn al-Hanafiyyah are da'if (weak) according to the people of hadith. And Allah knows best.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15143