Revert
Reverting in Git allows us to remove the changes associated with a
commit. The way this is implemented is by creating a new commit that
undoes the changes in the commit we are looking to Revert. It is easy to
get confused with this command and to think that it will revert the
state of the repo back to the commit that is specified, but that is
actually handled by the 'Reset' command. Revert only undoes the changes
from a single commit.
In the below we've added 3 files F1, F2 and F3 and we'd like to revert
the addition of F2. We can do this by running the Revert command against
#0194
Once we perform the Revert we get our new commit appended to the current
branch. Notice how the F1 and F3 files are still present after the
revert, and only the F2 file is reverted.
See the below video for more details on the Revert command using
VisualGit. Then give it a try for yourself