For example, I have a file called test1.txt
in my local folder. I've added it to the staging area using git add -A
. Now how can I move test1.txt
from the staging area to the working directory?
CodePudding user response:
Use git restore --staged test1.txt
to move back the file from stage area to working directory.
This command is also see, if you run git status
and you have files in the staging area.
As example:
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: test1.txt
If you are not familiar with the basic Git commands, have a look at this overall-picture: