Testicular torsion: the testicle twists on its cord and cuts off its own blood supply. It is an emergency; the longer it stays twisted, the more likely the testicle dies.
How it is done: the surgeon opens the scrotum, untwists the testicle and checks whether it pinks up. If it is alive, it is stitched in place (orchiopexy). The other testicle is stitched in place too, so it can't twist later.
If the testicle is dead: it is removed (orchiectomy) and sent to pathology.