You have to purchase the Counter Attack combat upgrade. It's 45,000 tech points. I'd also recommend the Combat Awareness upgrade, purchased for 5,000 tech points.
Once purchased, press B, right as an enemy hits you to perform a Counter Attack. Getting the timing right can be a little tough, but you should get the hang of it after a few tries. You can do this multiple times on one enemy.
This is a video showing the counter timing. This is not my video and I do not take credit for it.