This kind of ellipsis only works if the omission consists of the subject and a form of the verb 'to be' and the omitted subject appears in the main clause either as the subject or the object.
If (he is) found guilty, he faces six months in jail.
If (my computer is) broken, I will fix it. (subject-object)
Of course, the preceding sentence is only intelligible if it is clear from the context what the it is. And some might object that the "if broken" clause is a dangling participle.
The sentence If punch him, he gets hurt does not omit the verb to be. It is both unintelligible and ungrammatical. A grammatical alternative is:
If (he is) punched, he gets angry.