You can reset your Ledger Nano S to the factory settings by entering the wrong pin 3 times in a row. You will then need to restore your wallet using the 24-word backup key.