Newbie question: how to undo local changes in the git repository until the last click? I see a lot of hints for rolling back the last commit or all local changes, but not in this case.
You will find the commit you want to return to (say foo), and then say git reset --hard foo. The next push you do should be a strong push if you want it to go through.
foo
git reset --hard foo
Quick & Dirty way: delete the local branch and re-create it from the remote.
git checkout anotherBranch git branch -D branchA git checkout -b branchA origin/branchA
, , .
- , , ...
git revert git push origin master #assuming you on master branch
-
git rebase --interactive and delete a specific set of changes
You can do git reset for this. See Man git - reset.
In the git log, find the hash of the commit you want to return to. All changes after this commit are discarded.
By the way, here you will find a great book to learn git.