Reputation: 2235
There is a Revert command of Git in Android Studio 3.5.3, you can see Image 1. So I can use this command to give up all modification.
But I can't the Revert command in Vs 2019, I have installed Git Extensions, you can see Image 2.
How can I give up all modification in Vs 2019 when I use GitHub ?
Upvotes: 1
Views: 2999
Reputation: 3285
I did some reading about what the 'revert' button in Android Studio accomplishes, and it seems to me this is not a 'Git' Revert: it rolls back all the local changes that have not yet been committed. In Visual Studio there are two variants of this (none of which needs the Git Extensions):
Upvotes: 4
Reputation: 419
In order to get all the changes and revert to the previous commit,
git log
, get the commit id of the commit you wish to get.
git fetch origin <CommitId>
will get the commit changes.
git reset --hard FETCH_HEAD
will apply the changes to your local repository and at the backend its revert
which actually happens.
Upvotes: 1
Reputation: 3285
You can 'Revert' using the built in client: 'Changes' - 'Actions' - 'View history' ... Right click on specific commit and select 'Revert' in context menu:
You can Revert in the Git Extensions Window from the context menu (by right clicking, not via the command menu) for any commit:
Upvotes: 0
Reputation: 1323503
Your menu is done on the most recent commit, where you see "Undo last commit
"
Check if "Revert" is visible when you trigger the same contextual menu on a commit which is not the last one.
Upvotes: 1