The fear of the dead by the living is a deeply human emotion and can be found in all cultures of the world. In medieval northern Bavaria, too, there are indications that the local population feared being haunted by the deceased after their death. In order to keep these dead, who were called revenants, from doing what they were doing, a number of things were done.

For people of the early Middle Ages, the danger of becoming a revenant after death was an omnipresent problem. Anyone could meet this fate. To avoid this, it was extremely important to observe the locally valid rites of burial, to provide the right grave goods and to perform the customary acts of worship, mourning and lamentation.
Otherwise, there was a danger that the deceased would appear to the living as a reminder and take revenge for the lack of a proper burial. In the case of particularly vicious people, however, even a regular burial was not sufficient protection against a return of the dead. The dead person's wandering was considered a form of earthly purgatory. The damage that a revenant could cause was manifold: from the death of livestock, the absence of milk and offspring in cows, withering of crops in the fields, unusual weather events such as heavy rain, hail, lightning or illnesses of the inhabitants. If such a negative event immediately followed the death of a person, it was seen as an indication of his or her return. Now it was necessary to banish the revenant and people were very resourceful in doing so.

From impalement to decapitation
In the early Middle Ages, revenants were not understood to be ghosts, but veritable wandering corpses. Therefore, it was obvious to take measures to prevent the deceased from rising from the grave. In doing so, people drew from a rich palette of ideas.

According to a report by Bishop Burchard of Worms (*965 +1025), women who had died in childbirth were staked in the grave. This was to prevent them from harming their surviving infant as a revenant.
In the case of the early medieval row grave field of Mockersdorf (district of Neustadt a. d. Waldnaab, Upper Palatinate, Bavaria, Germany) a whole series of different revenant burials can be found. One person was already buried lying on his stomach during his burial, so that he could not rise to the surface. Another grave was subsequently reopened, the corpse decapitated and the skull impaled on the forearm.
The grave of a woman who was between 35 and 40 years old at the time of her death was opened several times. First, the body was decapitated and the skull was deposited slightly away from the body. In another opening, about a dozen large boulders were placed on the body.

Detail photo of the burial with the lower jaw impaled on the forearm. The skull has tilted backwards in the course of rotting. (Brundke Taf 16.2)
Burial with stone packing in the area of the upper body. (Brundke Taf 16.1)

With increasing Christianization, the way the phenomenon of revenants was dealt with also changed. In the imagination of the population, they were now no longer wandering corpses, but ghosts. Thus, manipulation of graves or bodies was no longer necessary. The means of choice were now prayers, read masses or the attachment of Christian symbols to banish the spirits.

With the overcoming of such archaic practices from the early modern era onwards, the belief in creepy walking corpses also ceased. However, the more artistic notion of the wandering undead has persisted to this day and can be found in the most diverse variations in contemporary pop culture.

Clarification:

Zombie: a "living" dead, a person might become a zombie by infection with a desease or by magical means of another person

Revenant: an actual corpse of a (naturally) deceased person who escapes its grave for various reasons, no third party involved

Ghost: spirit of a dead person, so no physical body

Vampire: fancy zombie in good shape and nice clothing


Literature:
Lexikon des Aberglaubens, Bd. 9, S.570-578.
Brundke 2013: N. Brundke, Das mittelalterliche Gräberfeld Mockersdorf – Archäologie im Schatten des Rauhen Kulm, in: Archäologische Beiträge zur Siedlungsgeschichte 3, Pressath 2013.