I often have a code on my phone, if i'm going somewhere, and after i opgraded my phone and maded a new code, i can not unlock my phone
You will need to restore your iPhone from the same computer that you most recently synced to.
Read this: http://support.apple.com/kb/ht1212
If you can't do the restoration then you will need to try recovery mode.
Read this: http://support.apple.com/kb/ht4097
Retrieving data ...