Today, as I was switching branches, I came across a problem with several of the project files. Git let me know that several files could not be unlinked, and even after making sure I had closed all processes (mainly VS) were closed. When I tried using the files, I realized they were locked by another process.
I hope you are familiar with Process Explorer- it’s a fantastic tool for sorting out process related problems. Run the executable, do a search for the file, and locate the process.
Depending on the process, either kill it or restart it.
Explorer.exe you usually want to restart, but if you kill the process you can start it again by starting a new process.