And if you'd wanted to simply reset the PIN when you were locked out at step one, you can do that using the find my phone feature:
Log into windowsphone.com and use the Find My Phone feature to set a new lock code
1.Go to
Windows Phones and sign to the Microsoft account associated with your phone.
2.Select "Find My Phone" from the drop down menu that appears when you click on your name. Or just go to
https://www.windowsphone.com/en-us/my/find
3.Click the "Lock" link
4.Enter a new 4 digit PIN code and press the Lock button.