Try dismissing him to one of your non-used settlements.. then just run away from him. Go to a different settlement, sleep or wait for 48 hours.. (I think that's the necessary time.) Then go to the settlement you sent him to and see if he's still hostile. If he is .. I don't know what to do if he's still hostile.
Also, by chance.. are you wearing power armor with targeting installed in it? I've heard that's glitchy and can make some people hostile. If you are, simply remove the helmet before dismissing him.
Experiencing something just as bad in my game right now. I know how it feels. Only suggestion I could make is hitting 'talk' and then 'relationship' on him. If that's an option, he'll tell you how he thinks things are going between you and him. I guess he might be on the border of being your enemy or something.
Thanks guys. I'll give this a shot. And no, I wasn't wearing power armor when this happened. I was wearing Kelloggs uniform and it was my first time stepping into the place where you find Cait. I dismissed Hancock for Cait and then Hancock started shootin at me.