Anyone else’s baby bop themselves in the head when you tell them no?

Any suggestions on how to stop this behavior? My husband was a head banging baby and I’m worried my LO May start doing this too!