No, it can't cure them but it can help with them.
Caffeine is the cheapest, easiest, most available drug to treat a migraine. It constricts blood vessels which can decrease pain. If you feel a migraine coming on, try drinking a cup or two of strong black coffee or a caffeinated soft drink, a simple treatment that works for many people.
Best cure for migraine headaches may be a cup of coffee or ...