Because of his popularity, Ganesha has many different creation stories. One of my favorites tells of his mother Parvati (the wife of Shiva) asking her husband for a child to keep her company during Shiva’s long absences. Shiva is known to wander into the mountains to meditate and practice yoga for thousands of years at a time and Parvati would grow lonely during these times. Hearing the desire of his wife Shiva granted her wish and blessed her with a son before departing into the mountains once again.
While he was gone his son Ganesha grew into a young man. One day Parvati went to take a bath and asked Ganesh to guard the secluded grotto where she was bathing and keep anyone from entering. Dutifully her son took up position to the entrance of the grotto and set about the task as she had asked. Unknown to Parvati, her husband Shiva had chosen this same time to descend from the mountains and return to their home. When Shiva came to the entrance guarded by Ganesha neither deity knew the other as Shiva had left for meditation before Ganesha had even been born. Shiva, not knowing that this was his son, demanded Ganesha stand aside and Ganesh, not knowing this was his father, refused him access in his effort to obey his mother’s request.
Of all the Hindu gods Shiva is both known for his terrible wrath which can be easily provoked, but also for being easily appeased and easily approached by his devotees. So when he came across his son Ganesh guarding the entrance to his home and denying him entrance he quickly grew enraged and with one quick strike he severed Ganasha’s head from his body, unknowingly killing his own son.
When Parvati came out from her bath she was distressed and dismayed to see what had happened. She implored her husband to return her son from death and seeing her anguish and realizing his error Shiva quickly complied. He sent his servants out to return with the head of the first living thing they encountered which happened to be an elephant. Using his mystic potency, Shiva united his son’s dead body with the elephant head and restored Ganesha to life and his new form as India’s famous elephant god.