Es geht so wie Alex es beschrieben / verlinkt hat. Ich hatte das gleiche Problem - und es folgendermaßen gelöst:
Restoring a Nandroid Backup
Note: If you happened to forget to remove lockscreen security (PIN/Pattern/Fingerprint) before
creating your backup, and you cannot get into your OS after restoring, you can do the
following to fix the issue.
Boot into TWRP and use the built in file manager to
delete /data/sytem/locksettings.db.
This should be enough to get you into your OS again. If it isn't you can also try
deleting /data/system/locksettings.db-shm and /data/system/locksettings.db-wal.
If this still doesn't fix your issue you can delete /data/system/gatekeeper.password.key
and /data/system/gatekeeper.pattern.key.
das Löschen der "locksettings.db" hat bei mir ausgereicht.