After I checked out a branch and did a "git pull" on it, git thinks that I have deleted a file:
> git status
On branch feature-support
Your branch is up to date with 'origin/feature-support'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: mvnw
However, that is not true, as the mvnw file is still in the directory. I have tried the following commands from this answer and other answers and I am not able to unstage this deleted file, which is preventing me from unstashing some files:
git restore --staged mvnw
git reset -- mvnw
git checkout -- mvnw
git reset HEAD mvnw
git reset HEAD .
git reset HEAD
git restore --staged -- mvnw
git reset mvnw
git checkout mvnw
git checkout .
git reset --hard
git clean -fd
git clean -f
How can I unstage that deleted file?
EDIT: Running the git restore --staged . command resolved the issue for the mvnw file, however, a new deleted file showed up in Changes to be committed and I can't get it to go away:
deleted: our-project/src/test/resources/etc/ABCD-EFGH.
For the
mvnwfile, I resolved the issue with thegit restore --staged .command.For the
our-project/src/test/resources/etc/ABCD-EFGH.file, I resolved the issue with thegit config core.protectNTFS falsecommand. Viewing theour-project/src/test/resources/etc/directory on GitHub, I can see 3 files:It appears Windows cannot handle a file named
ABCD-EFGH.(with a dot at the end), and thegit config core.protectNTFS falsecommand resolves that. I still seedeleted: our-project/src/test/resources/etc/ABCD-EFGH.in theChanges not staged for commitsection, but it is not preventing any git operations like it did when it was listed under theChanges to be committedsection.