you can go to a pc browser, account.microsoft.com -sign in, head to devices tab and lock your device. once your device is locked, you can then unlock it using that code
If you need additional help or have more questions or details to share, please join the site so you can reply in this thread. See this link for instructions on how to join Windows Central.
follow these steps: THIS WALK THROUGH IS TO HARD RESET YOUR DEVICE, YOU WILL LOOSE ALL YOUR PHONE DATA ( data stored in phone memory)
>Switch off the phone.
>Press and hold the Volume Down button and connect your charger. When you see an exclamation mark release the button.
>Now press the keys in this sequence: Volume Up. Volume Down. Power. ...
>The phone will reset and reboots.