There are a bunch of folk remedies for an ice cream headache.
Try using your tongue to warm up the hard palate at the roof of your mouth.
Or place something cold across the bridge of your nose and your forehead for a few seconds to restrict the blood vessels from the opposite direction while the other ones warm and reopen.
Of course, the best defense is to avoid the headaches from the start.
Eat cold things with the sides of the mouth instead of up against the roof of the mouth.
Or next time you eat ice cream, get a cup of coffee to use as a chaser.
An ice cream headache, also known as brain freeze, is commonly caused by fast consumption cold beverages or foods such as ice cream and Popsicles.