There's a little lip moulded into the rear section of the headliner that's supposed to fit into a small groove above the rear screen. When fitting the headliner this lip is the first thing you should locate, pushing it forwards to hold it there and then fit the remainder of the fixings.
You might be lucky and manage to get it back into position without having to remove it. If this doesn't work then you'll have to release it and then refit it properly.
Fixings are the A, B and C pilar trims, grab handles, sunroof frame and sun visors. There might be a screw or two behind the light unit, I can't remember!
The most awkward will be the sunroof screws, theres about 16 small tx10 screws that hold onto the roof. Accessing the rear row of screws is quite a job, as the sunroof panel needs to be removed, iirc. (There's a little something making me think that it's just the sunroof sliding cover that needs to be moved back, which is very easy in comparison. This cover needs to be moved prior to removing the sunroof panel anyway, you could check at that time.) Have a look at the instructions in the dis, look at both glass and steel sunroof removal and obviously headlining removal!