This error is always reported when using git to switch branches today.
Solution:
In the .git folder of the project folder (this is a hidden folder, you need to find the file index.lock that cannot be created in the file management navigation bar - tools - folder options - view - check show hidden folders) Just re-git checkout dev