To figuratively "throw the baby out with the bathwater" is to discard the good alongside the bad.
In old England, dirty, used bathwater from a baby's bath was discarded behind a house. No one sane would ever throw out the baby with the bathwater. Therefore, this expression describes an act of extreme foolishness and a complete lack of understanding of value and worth.
Example: "It is simply wrong to replace the entire marketing staff just because of one failed sales campaign. There are some people that need replacing, yes, but don't throw the baby out with the bathwater! We need to hold onto the good people that we already have."