What is the point of undoing this commit and rolling back this commit on GitHub for Windows?

On Github for Windows, these two commands are described as:

  • revert this commit - create a new commit that returns changes to this commit.
  • rollback this commit - rollback this commit, leaving all the changes made to it, and then shutting down in your working directory

Could you explain the exact meaning of these two commands and how they can be used. In particular, I do not understand what is the purpose of the second. It makes no sense to me.

Is it possible to return to the previous commit, and if I do not like it, return to where it was originally?

This gui seems to contain a very small part of the git system, but what will be the correct workflow using it?

+42
github revert github-for-windows rollback
Feb 23 '13 at 10:02
source share
2 answers

Suppose you have one file in your repo and you have the following commits:

 commit 1 : the file contains A commit 2 : the file contains B commit 3 : the file contains C 

If you return to commit 3 , you will get this in the repo:

 commit 1 : the file contains A commit 2 : the file contains B commit 3 : the file contains C commit 4 : the file contains B 

And the file in your working copy will also contain B.

If you roll back you will get this in the repo:

 commit 1 : the file contains A commit 2 : the file contains B 

And the file in your working copy will be left unchanged. Thus, the file will contain C. It allows, for example, to correct a small error and try again.

+51
Feb 23 '13 at 10:22
source share

Is it possible to return to the previous commit, and if I do not like it, return to where it was originally?

Now (since March 2013), with GitHub for Windows, you can cancel the rollback without having to enter the git command:

See " Cancel button on GitHub for Windows "

we added Cancel support for garbage, commands, rollbacks and merges :

Undo button

+11
Mar 21 '13 at 10:37
source share



All Articles