Anchor the thread under the fold. Work small backstitches along the existing seam, overlapping the intact stitches at both ends. Keep the other side of the leg clear of the needle.
Run the needle under a few finished stitches, tie off, and trim the thread. Turn the leg out to check the hem. Compare the repaired section with the other leg before pressing.