$ git restore --staged *.css If you want to discard uncommitted local changes in a file, simply omit the--stagedflag. Keep in mind, however, that you cannot undo this! $ git restore index.html Another interestin
$ git restore --staged myFile.js This will remove the file from the Staging Area, making sure that it will NOT be part of the next commit. In case you also want todiscardthe local changes in this file, you can simply remove the--stagedoption: ...
2. Unstage Files using git reset The most effortless way to unstage files on Git is by using the “git reset” command and specify the file you want to unstage. git reset <commit> -- <path> By default, the commit parameter is optional: if you don’t specify it, it will be referrin...
It is essential for commit message to line up with changes. What if you accidentally staged a file that was not intended for current commit? git rm --cached <FILE-NAME> Copy Specifying a file name when you use the command provided above will unstage a single file (or more, depending on...
Linked Answers Q:https://answers.atlassian.com/questions/112557/git-amend-a-commit-do-more-than-change-the-message?page=1 Basically need to be able to do a commit and specify you want to amend the previous commit but also unstage/stage files from the previous commit if you like (as well...