Very very carefully, and with a lot of effort.
I've only done this once with a Baby Leaper who needed a rehair, and boy is it not fun. The heads are glued on super-well, much better than your average G1. The body has a disc-plate with the ball on a post, while the head has a clear two-piece socket. These two parts are not going to separate unless you get the head off, so don't try. Don't twist or bend the head side to side too far, as the weakest point is the ball joint itself. You'll probably have to coax the plate out with tools. If you only have to deal with the tail I'd try pulling it only partially loose, enough to get the tail out and back in but not separating the whole thing. That way you should just be able to push the ball joint plug/plate bit back in and not need to glue it when you're done. Good luck!