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.