Just happened to me, after I allowed an Android upgrade to install overnight. The unlock pattern and the backup code got reset to something I didn't know. Restarting the phone returned it into a normal state where I could unlock it with my pattern.
Lesson learned: don't use the "Install...