I hit my SO :(

So me & my SO got into a very heated argument. When he gets mad, he gets Mad. Long story short he grabed both my hands and put them over my head. I am 21 weeks pregnant and I was scared he would push me down or God forbid hit me. Since I didn't have control of my hands to try and push him away I hit him in the mouth with my head. I feel TERRIBLE and like a POS physco GF. He was in shock that I even did that. I can't seem to forget about the situation and I don't think I'll ever forget myself. I'm not the Type of person to do this but I felt like I had no choice. I just wanted him to calm down. Was I wrong?