I had your question, as well as the question of "how do I fix it". I couldn't figure out a way to fix it with SourceTree. (normally it gives more options than GitHub desktop.)
As Micha and Luis point out, the literal answer to your question is that you have three versions of the file, and yes they have to be handled with care, as they are all different. In other words, yes the staged file is different from HEAD (any staged file would be). The versions are:
- The original file in source control
- The file staged, newer than what's committed
- The file on disk, even newer than what's committed or in source control
The use case is, you staged the files, then you change it in your IDE say, then you went back to remove the commit to stage your actual changed file, and you got this error.
SourceTree wouldn't let me stage the new file, nor would it let me unstage the file, giving this error message. As we have some CI/CD pipelines setup, I did not want to commit the file; I wanted the newest file.
The fix for me was to use the git CLI. A simple
git add offendingfile.js
did the trick. Why SourceTree couldn't do it, I'm not sure.