If while a married couple are divorcing but before the husband has given a get at the Beit Din, the woman gets pregnant from a new boyfriend, can a get be given retroactively? Would it help that the husband had at some point beforehand told her that for all he cares she can date / go out with whomever she wants to, can prove he said so in a dated email exchange with the woman, and would cooperate in an effort to prevent mamzerut?
Hello Baal Rishon, and welcome to J.SE.
It sounds like there's a very thorny situation underfoot, and this is going to require a real-life expert rabbi. I strongly recommend you contact the experts at the Beth Din of America. May G-d help everyone involved in this difficult matter, and may it be concluded in such a way that the pain to everyone involved is minimized.
Hopefully we can give some background information:
Firstly, I should point out a halacha that has been the saving grace in many situations like one -- a child can only be rendered a mamzer if both its biological parents were Jewish.
But basically, no; there is no way to give a Get now that would have it work back in time. The Talmud Gittin 17a says that a Get must accurately document its date to prevent a man from falsely claiming that he gave it before his adulterous wife (now ex-wife) had relations with another man.
The Talmud describes a small handful of rare situations in which the rabbis retroactively annul the entire marriage, but these are few and far between and would require an expert.
Consent to the adultery doesn't help.
However, the case could occasionally be made that the entire marriage was a joke to begin with (e.g. Rabbi Moshe Feinstein addresses a sham wedding conducted just to obtain a green card), or that the marriage was based on faulty premises because at the time of the wedding there was some serious deal-breaker preexisting condition of which one spouse was not aware. If the intention was clearly an "open marriage" from Day One, it could perhaps be argued that this was never halachic marriage. Once again, this is a job for an expert to address.
Lastly, if the first wedding did not meet Orthodox standards (e.g. two adult, male, non-related, Shabbat-observant witnesses), many rabbis would declare the child not a mamzer. This was the opinion of Rabbi Moshe Feinstein and, after some deliberation, Rabbi Joseph Dov Soloveichik.
A get can only be a get from the time that it is actually given, so it cannot be given retroactively.
But a dated get can be given with a stipulation that it will not take effect until a certain date or until a certain condition is fulfilled in the future, at which time the get will be effective from the time it was given.