When less than 45 years old and married with a spouse covered by public insurance, it may be worth taking a year off work (e.g. a sabbatical; must earn less than EUR435/month) to undo that damage.
(Details:
You can go back once you're covered by public insurance for 12 months, no matter through which status, so family insurance helps get these months. For family insurance your income needs to be below EU435/month + some exceptions.
The outcome changes a bit when you're older than 45 because you need ~20 years (in raw terms: more than 90% of the second half of your working life) in total in the public insurance scheme to be able to apply for the "public health insurance for pensioners" system when you retire. That complicates matters.
Even more details for people not used to the German health insurance system:
By default people are in the public health insurance system. Exceptions are self-employed folks, public officials and people with income beyond the cap mentioned upthread: they can choose whether to use the public system or some private health insurance.
The reason why you can't just move from private insurance to public insurance is that otherwise the private insurers would try to get ahold of all the healthy youngsters and their (usually significant) money while offloading them to the public system as soon as they start to cost more than they bring. That would break the economics of the public insurance system.)