As a ritual, during Antyeṣṭi, the dead person's head is hit with a bamboo stick in between the burning of the whole body. As far as my understanding goes, this is done so that the person won't remember all the deeds and person of this birth in the next birth.
But on the other hand, I believe that Ātma departs from body right after the person dies. Or because Ātma leaves the body, the person dies. Then, what is the benefit of hitting the head?