My horse Tuffy was head shy when I first got him, but I taught him to relax and now he is not. I just consistently worked with him, let him know I'd never hit him, and eventually he came to trust me. I purposely waved my hands close, suddenly reach up and scratch his ear, grab his nose and rub it, whip a hand up with a treat, pull my hat off and put it on his head. He probably thought I was the strangest human he'd ever met, but harmless, and in a couple months he stopped whipping his head, flinching, or hardly batting an eye.
Unfortunately before he came around, my girlfriend Cindy waved a grain scoop at him while I was standing next to him and he whipped his head sideways and gave me a great big beautiful black eye. It felt like I had been punched by George Forman or maybe Mohammid Ali, whoever punches harder.