Fluctuating blood sugar is thought to be linked to headaches, and a good slow-burning carbohydrate can help keep this in balance. People who get migraines also often exhibit low levels of magnesium, so eating some magnesium-rich whole grain cereal or oatmeal is recommended.
Consuming carbs in the form of healthy whole grains allows the body to replenish its stores of glycogen, which is the primary source of fuel for your brain. Reduced energy to the brain also leads to dehydration, a major headache trigger.
One thing to note is that gluten can be a migraine trigger in some people. If this includes you, skip the wheat and stick to gluten-free grains such as quinoa, rice, millet, amaranth, and corn.