You have to think about the solubility of DNA in water and ethanol.The surface of DNA is highly charged and as a result a polar solution will dissolve DNA.Water is more polar then ethanol,so DNA has higher solubility in water than in ethanol.
When you put in some ethanol that is not evenly mixed with water,DNA precipitates.But when water and ethanol are mixed again,DNA is dissolved.