The Neanderthals did trepanning, so did the ancient Peruvians, the Babylonians, and the ancient Celts.
Prehistoric skulls have been found in Germany not only with lovely neat round holes cut in them, but regrowth of the bone to fill the hole . . . which shows that the patients actually SURVIVED the operation.
They may have been trying to let "evil spirits" out, but in the case of a traumatic head injury it was the right thing to do.