The phrase “throw the baby out with the bathwater” appears to be German in origin, and it essentially means that the good should not be discarded along with the bad due to inattention or haste. Before one gets a mental image of flying babies and dirty bathwater, it should be added that this term was always used as a metaphor to suggest that people should not race to hasty decisions, not that parents would actually throw their baby out.
No one is quite sure when the Germans first started saying that one shouldn't throw the baby out with the bathwater, but by the 1600s, the term was common enough for it to be referenced by astronomer Johannes Kepler in a way which suggested that he assumed that his readers knew what he was talking about. From Germany, the slang term spread to France, and then into England. By 1853, Thomas Carlyle was mentioning the need to avoid tossing the baby out with the bathwater, and he also referenced the fact that the proverb was of German origin.
One might reasonably wonder how it is that people could even imagine that someone could throw the baby out with the bathwater by accident. The explanation for this term lies in the fact that Europeans bathed infrequently after the Middle Ages, for a variety of reasons; many people, for example, thought that bathing was unhealthy, and avoided it except on rare occasions. When people did bathe, they filled a large tub with water heated on the stove, and the whole family took turns using it, with the oldest going first.
By the time young children reached the bathtub, the water would be tepid, and rather dirty, thanks to the previous bathers. One can easily imagine an infant slipping into the water and becoming obscured by the muddy gloom, although since someone had to be present to bathe the infant, it is unlikely that the baby would have slipped entirely below the surface, or that someone would have dumped the baby out when emptying the tub, since most people keep track of the location of their babies. The image of tossing the cloudy contents of the bath without pulling the baby out first would have been compelling to Europeans living in this era, even if it never actually happened.
This slang term references the idea that hasty decisions can sometimes result in disastrous consequences. Sometimes, it is necessary to take a break to find the good and the bad in a situation before making a choice about what to do; in other words, take the baby out of the tub so that you don't toss him or her away.