The smart thing would have been to push him away, protecting your friend.

Then if he swings at you punch him back in self defence.