A pupa that falls or is dented may well be infected with disease. It may be best to euthanise the pupa (by wrapping it in a tissue, and putting it in the deep-freeze). You certainly don’t want to foster disease or a virus.
If you are sure the chrysalis is not diseased (e.g. you knocked it off yourself) it can be rehung by tying cotton around the cremaster (the black stump at the top), using miniature pegs, or it can be glued by using a hot-melt or preferably a cool-melt glue gun. Place a bead of glue on a suitable support and then place the silk mat or the cremaster into the glue.