Wouldn't the atmosphere on Mars sublimate all of his water supply? He even says that the water reclaimer's tubes burst due to the event.
This question on the Space Exploration Stack Exchange about what would happen if you had a pool on Mars and it was exposed to atmosphere has the answer you're looking for.
In summary, the drop in atmospheric pressure would cause some of the water to boil off right away, but boiling causes what is left behind to become colder. The first layer of water to boil off would leave a layer of ice behind, and ice doesn't sublimate nearly as quickly under low atmospheric pressure. With the layer of ice protecting it, any water sealed between a container and the ice layer should either freeze, or remain as is. If Watney acted quickly enough (we're not talking seconds here, more like hours to days or more), all he just needs to do is seal up the hab and repressurize, which will allow all that ice to melt back into water. In the end, he'd lose some water, but not all of it. How much depends on a bunch of factors that I wouldn't know how to calculate even if I did know the exact setup.
Edit: Drew Stephens in a comment below found a great video demonstrating this in a vacuum chamber. In that experiment, it looks like he only lost about 1/3 of the total water to boiling.
Mark generated his own water, by burning Hydrazine (N2H4). In the film, this initially caused a minor explosion... I can't recall if the same thing happened in the book. Even if all the water he had gathered boiled/sublimated, he could probably generate more, assuming he still had hydrazine and LOX.
Hydrazine is used as rocket fuel, and may have been used in the MDV which remained on Mars.
It's probably worth pointing out that the water he generated wasn't intended as drinking water for him; it was needed to grow his potatoes. With all the plants dead, he wouldn't need as large a supply. He probably could have recovered enough for his own needs as detailed in Cody's answer.