By swinging their heads like a club. There's a British zoo, I forget which one, where one of the male giraffes swung at his keeper, missed and left quite a deep dent in a thick piece of hardwood, and...
A giraffe defends itself by swinging its neck so that it creates a large impact on the animal. This happens usually with male giraffe dominence fights hitting the others ones neck, but they don't...