I would start by saying I have never had to do this and I am just thinking what I might try to get things back together again. If it were mine, I would be looking to get the trunk lid reconnected to the normal opening hinges on both sides. I would see if I could get to the convertible pump cover and loosen the pressure release hex screw and attempt to manually move the claws that attached to the small white hydraulic ram in pic 1. Basically an attempt to get the trunk lid held in place properly by the main hinges with the claws re-secured. If I could not move the claws by hand I would try unclipping / removing the hydraulic rams so that the claw would move freely. If I were able to get the trunk lid back in place that would leave the reversing hinge being out of place. With the pressure released on the pump that should also be possible to carefully push back into position, possibly using the locating pin holes with a bar for leverage if needed.
What is a little strange is that in the two long slots in the second picture there are claw hooks that are supposed to clamp round the metal wheel like objects near the locating pins on the trunk lid. These are supposed to prevent the trunk lid coming away like yours did, yet they seem to be retracted.
Best of luck and hope you manage to fix it.