“He needn’t have beaten the child.” means:

The child needed to be beaten.
He didn’t beat the child
He beat the child.
He needed to beat the child.
Intermediate Grammar Exercises
Upper-Intermediate Grammar Exercises
English Modals Tests
Fiverr 2021 English Level Tests