According to legend, after winning the war of Kurukshetra, the Pandavas were feeling guilty of killing their relatives and sought to get blessings from Lord Shiva for absolving themselves of the sin commited by them.
In order to thwart their attention Lord Shiva disguised himself as a bull and hid in Kedarnath mountains. When he was being trailed by the Pandavas he plunged into the ground leaving the hump on the surface.
It is believed that the arms of the bull appeared at Tungnath, the face at Rudranath, the belly at Madmaheshwar and his locks (hair) with head at Kalpeshwar. Thus Kedarnath along with the other four shrines are called as Panch Kedar.