You should actually have the phone restored to factory settings and hence the security code will be reset to its original one and hence you will have the problem solved. You have nevertheless not indicated the phone make and model for appropriate help.