If I remember correctly, Adam was attacking Gwen and Maddie tried to stop him. She pushed him and he hit his head. Maddie and Gwen thought he was dead and they buried him. He haunted them for a minute before the gang (Maddie, Casey, Gwen and Will) found out he was alive.