How can diet help prevent migraines?

How can diet help prevent migraines?