The spermatic cord needs to be untwisted (de-torsion) to restore the blood supply. Lasting damage starts after 6 hours of torsion. One study found that nearly 3 in 4 patients need the testicle removed ("orchidectomy") if surgery is delayed past 12 hours.
Ideally you can see a urologist for treatment. All patients with torsion will need surgery. It is possible to untwist the chord in the emergency room, but surgery is still needed. At surgery, the urologist will untwist the testicle and sew stitches to prevent future torsion. Most often, this is done through the scrotum. Sometimes it is done through the groin.
If the testicle cannot be saved, the urologist will remove the testicle and sew stitches around the other testicle to prevent future torsion. This can only be determined at the time of surgery.
The testes of newborns with torsion can rarely be saved. The testes are almost always infarcted (dead). Emergency surgery is not the same with infants. With infants, there have been cases of the second side twisting shortly after birth. This would leave the baby with no testes. With better anesthesia and post-op care, many pediatric urologists will operate within the first few hours or days of life. The infarcted testicle would be removed, and stitches would be used to prevent torsion in the second testis.