This chapter examines the role of ghosts and restless corpses in medieval and early modern texts. It argues that the undead were employed by the narrators to convey a certain message and that different roles were assigned to ghosts and to restless corpses. Thus, ghosts were usually used in the narratives where a dead person was portrayed to return to warn the living about hell and purgatory, as well as to ask for help to facilitate the soul's progress towards heaven. At the same time, one's turning into a walking corpse usually appeared in a 'cautionary tale' type of narrative where an individual was portrayed to be punished for their sins. Therefore, this chapter examines which types of offences were considered as leading to restlessness and why. It also presents the evidence against the popular assumption that being buried away from the consecrated ground was believed to cause one's turning into a restless corpse. On the contrary, in many sources, as this chapter demonstrates, the individuals who later turned into revenants had received a proper burial. Finally, the chapter examines the actions taken by the living in order to get rid of ghosts and wandering corpses, such as prayers, burning a corpse or dumping it into water, as well as the meaning attached to these apotropaic rituals.