Depending where exactly the material has come loose, you may be able to make an in-situ repair using adhesive carpet spray - hold the headlining away from the backing board (biscuit) and spray some glue onto the biscuit. Let the glue "flash off" then carefully and progressively fit the liner back onto it. I've used this trick on many cars over the years and it usually works well.
However, if yours is truly horrible, you may have to bite the bullet and take the complete headlining down.