What do we do when the dead come back to life? This story happened to relatives in our family: A man and wife marry, and before they can start a family, the husband is called to serve in the Bulgarian army (this is the Balkan Wars 1913). One day his squad is ambushed in the mountains, and the husband gets shot. Since there is only one path to escape from, the dying husband sacrifices his life by telling the other soldiers to escape while he stays to stall the incoming troops. The fellow soldiers report the news of the husband’s death. The husband’s wife receives a national medal for his heroism. They "bury" the husband in a cemetery (tombstone but no body), and the family observes shiva. Years later the wife remarries and has children. Years after that, a man with a limp arrives in the village asking for his wife. They recognize the husband, inform him of the news, and he disappears. If this were to go to a beit din: What would the statuses of the 1st and 2nd husbands be? What is the status of the children? What should be done in such a confrontation? Perhaps a number of such cases have occurred in light of shoah survivors and Israeli wars. I have yet to ever hear a tshuvah on a such an unfortunate sheilah.
The basic law in a difficult case like this; appears already in the Mishnah and Gemara Yevamot 87b – 88b. She should leave both husbands, i.e. she is forbidden to the second husband because she is an Eishet Ish, she is still married to the first husband. And she cannot return to the first husband due to her adultery with the second husband. She needs a Get (divorce certificate) from both husbands, i.e. if she desires to marry another, she requires a Get from her first husband who is actually her real husband. And the rabbis instituted that she requires a Get from the second husband as well, due to a fear that people may think that she is legally married to the second husband, and when they see her leaving without a Get they may misunderstand and mistakenly conclude that an Eishet Ish can leave without a Get. A child from either husband is a Mamzer (illegitimate), i.e. the child that was born from the second husband is a Mamzer according to the Torah; and the child that was born from the first husband after he resumed living with her is a Mamzer according to rabbinic law. The right thing to do in a case of serious questions regarding Agunot and even more so in a story like you raised, is to turn to the greatest Poskim of the generation so they should determine in these matters. Responsa Maharsham discusses a very similar case to the one you raised. He writes that the law is clear that she must leave both husbands. But regarding the child he writes a resourceful suggestion in Halacha but not in practice, that theoretically there is a way to expropriate the Kiddushin of the first husband in order to prevent the child’s illegitimacy. In Minchat Shlomo Kama Rabbi Shlomo Zalmen Auerbach ZT”L quotes the Maharsham and discusses it at length. He concludes that there are several doubts regarding the Maharsham’s suggestion. So it is obvious that this suggestion is not Halacha L’maaseh. However it is possible that this suggestion may be taken into account as part of the Posek’s various considerations when he comes to determinate the status of the children. [יבמות פז: - פח:, שו"ת מהרש"ם ח"א סימן ט, מנחת שלמה קמא חלק שני סימן עו].