The hem on one of my tees unraveled in the wash. I found two very long pieces of thread still attached to it.
One thread was still sewn through the material. I threaded a needle with the piece attached to it, and ran the needle through all of the loops on the backside of the tee.
I used the second long thread to back-stitch the hem. (See http://www.wikihow.com/Backstitch) I then sewed the raw edges to the back stitched seam.
The front of the t-shirt looks just as it did when I bought it. The back will not ravel again and the thread is a perfect match.