October 2017
Intermediate to advanced
458 pages
11h 13m
English
Sometimes, you just want to get rid of whatever it is you did. Whether you just want to clean your working directory or you want to actually undo some items you (accidentally) committed, Git makes it possible.
There are a couple of scenarios we can think of that we want reverted. The first is quite simple. We have staged some files and we simply want to unstage everything. The git reset command does this:
git statusOn branch masterChanges to be committed: (use "git reset HEAD <file>..." to unstage) new file: accidentally added.txt modified: kernel.txt deleted: lasers.txtgit resetUnstaged changes after reset:M kernel.txtD lasers.txtgit statusOn branch masterChanges not staged for commit: (use "git add/rm <file>..." to update ...
Read now
Unlock full access