Knee Jerk Reaction

You use the phrase ‘Knee Jerk Reaction’ to indicate that you’ve made an automatic response to something.
Example of use: “I hauled off and hit him when he jumped out at me. I know he was playing a trick, but it was a knee jerk reaction!”