Even though the fast starts at alot hashachar, the prohibition to eat sometimes begins the night before. If one has in mind not to eat anymore until the beginning of the fast, it is considered as if he accepted the fast upon himself, and he may not eat. Therefore, one who goes to sleep the night before a fast and wakes up before daybreak may not eat, for he has already taken his mind off of eating. However, if he stipulates mentally before going to sleep that he will eat something if he wakes up before alot hashachar, he may eat, because he has not yet accepted the fast upon himself.
All this is true with regard to eating, but the poskim debate the issue of drinking. According to the Rama, one may drink even if he did not make an explicit stipulation before going to sleep, because many people take a drink of water when they wake up, and it is therefore as if he had intention to drink if he wakes up before daybreak. The Shulchan Aruch (564:1), however, holds that there is no difference between eating and drinking, and only one who stipulates, before going to sleep, that he will drink some water when he rises before daybreak may drink. In practice, one who wants to drink before the fast begins should make a mental stipulation to this effect, but be’di’avad, one who wakes up before alot hashachar and is thirsty may drink, even if he failed to stipulate (see MB 564:6, KHC 10).
With regard to drinking water, since the dispute is over a Rabbinic law, the halakha follows the more lenient opinion. Moreover, it seems that the Rif agrees with the Rosh who rules leniently. The Taz (2) also concurs. Nonetheless, it is best to stipulate, as the Magen Avraham (564:2) and Mishnah Berurah (6) write. Kaf HaChayim (10) cites several Acharonim who say that one who has a craving to drink may do so.
Tangentially, I would point out that regarding the prohibition of eating before Shacharit on a regular day, one is allowed to eat until alot hashachar, and one may start a meal a half-hour beforehand. According to the custom of the kabbalists, however, one should not eat anything before praying in the morning, assuming one slept a substantial amount of time (KHC 7). But even the kabbalists act leniently when it comes to drinking.