GIT add refund to my case (save changes)

After making changes to the file. I am using git add FILE_NAME .

Then I would like to return it as not being added , but in the meantime save the changes , how to do it?

+8
source share
4 answers

git reset -- FILE_NAME will do this.

See git reset manual :

This form resets index entries for all <paths> to their state in <commit> . (This does not affect the working tree or current branch.)

This means that git reset <paths> opposite of git add <paths> .

+18
source
 git stash save git stash apply 

they will all be unidentified

+3
source

you can use

git reset --mixed -- <filename>

if you use --hard, you will discard all your changes.

+1
source

You can use git reset

+1
source

Source: https://habr.com/ru/post/903124/


All Articles