Coffee just has a slight diuretic effect, it does NOT mean it dehydrates you. Drink several cups of water and you will have to pee real quick, but it still has a net hydrating effect.
The mild diuretic effect in coffee does not even last long. If you are habitual coffee drinker, research shows you will develop a tolerance to it within several days. So not only will it actually hydrate you, soon enough it won't even have the mild diuretic effect.