This happened to my male last year. Due to the timing, my vet was closed for the day by the time it happened, and the turtle's business was out for about 24 hours before I got him to the vet. Took an hour or two for the vet to get him back to normal, with me keeping the turtles front half in the shell the the back half would be a little more accessible. I believe he lubed the organ with KY or something similar, then used a thermometer to slowly work it back it. Given the amount of time involved, the vet bill was very reasonable, too--I think it was about $15 (obviously, mileage may vary).
Hope everything works out okay.