Deselect a node before detaching it from the tree.