![]() ![]() ![]() Nothing added to commit but untracked files present (use "git add" to track)Īs you probably understood it by now, the “ git reset” command is doing the exact opposite of the “ git add” command : it removes files from the index. You can now check the status of your working directory again with “git status” $ git status In order to unstage the README file, you would execute the following command $ git reset - README Your branch is up to date with 'origin/master'. This command will reset the index entries (the ones you added to your staging area) to their state at the specified commit (or HEAD if you didn’t specify any commits).Īlso, we use the double dashes as argument disambiguation meaning that the argument that you are specifying may be related to two distinct objects : branches and directories for example.Īs a quick example, let’s pretend that you added a file named “README” to your staging area, but now you want to unstage this file. git reset - īy default, the commit parameter is optional : if you don’t specify it, it will be referring to HEAD. The easiest way to unstage files on Git is to use the “ git reset ” command and specify the file you want to unstage.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |