Local discrete symmetry and quantum-mechanical hair