"Wrong Pattern" After Flashing Image I wanted to update my OnePlus 3 to OxygenOS 4 using TWRP but that resulted in an error. I tried again, same error. I flashed the old image again, no error, phone was usable again, updated TWRP, flashed the new image again, different error. I then flashed the old image, again, no error.

However, my phone isn't usable right now because I can't unlock it. I definitely remember my pattern, I had it since I bought my the OnePlus 3 and I bought it right when it came out. I have to enter it every time I reboot so I entered it several times just today and there is just no way I remember it incorrectly. Furthermore, I have a second phone with the same pattern. I drew it on both phones simultaneously and only the other phone unlocked. 

How can I log into my phone, again?
Note that @dan-brown seems to be right about the root cause of the issue - it looks like a corrupt install after flashing a new TWRP.

However there is a non-destructive fix, as documented here.


Boot into recovery 
Navigate to /data/system
Delete the following files:


password.key
pattern.key
locksettings.db
locksettings.db-shm
locksettings.db-wal 

Reboot