Headaches can be cause by any type of substance withdrawal such as caffiene,nicotine, sugar, and yes- even food!
You deprive your body of something it 'wants' and it will pull a temper tantrum.
The good news is.... ( no Gieko Jokes).... this should last no longer than 5 days or so.
The Better news is... after the fast, you need not return to the the caffiene, sugar, and nicotine, and you should be in a better phyisical and emotional position to make good/better eating decisions!
Warmest Regards,