Parenting mistakes! Breaking the cycle

I guess this is more of a rant and hope that I’m

not alone.

I realize at times my impulse kicks in on how I respond to bad behavior with my son. Sometimes I’m not thinking. if my son hits me or my husband I snap. I don’t hit him back of course but I definitely do respond intense and in some since scare the heck out of him. I absolutely lost my temper last night when he threw a hard object at my husband and then slapped me across my face.. I restrained him, admittedly pretty rough then put him in his room for a time out. I feel awful and could not sleep last night over replaying the expression of my sweet boy’s face in fear of me. My mother was extremely physically aggressive with me to the point that child services got involved. I just never ever want my kids to feel unsafe in their own home like I did. It’s crazy how what you grew up with somehow plays out in your adulthood. I guess what I’m saying is I don’t want to be like my mother. Has anyone else dealt with challenging yourself to break a cycle?