Electrolytes. Bunch of water is good, but depletes electrolytes which can(will) cause headaches. Keep up the water, but keep up electrolyte intake, as well.
If you are quitting a caffeine habit, that could cause headaches as well. Just depends on how, well, dependent on it you are.