A rhizotomy ( ) is a term chiefly referring to a neurosurgical procedure that selectively destroys problematic nerve roots in the spinal cord , most often to relieve the symptoms of neuromuscular conditions such as spastic diplegia and other forms of spastic cerebral palsy .