How to restore ps layer after unlocking?

The first method:

If you want to restore the state before unlocking after opening the diagram without closing it, you can click Edit-Restore.

The second method:

If you close the picture after unlocking, open the unlocked picture and see the small lock above the layer. Just click on it and the layer will be locked.