8 Useful But Not Well-Known Git Concepts: Checkout Cherry-Pick
8 Useful But Not Well-Known Git Concepts: Checkout Cherry-Pick
[Undo local changes] When the changes haven’t been pushed yet
If I want to totally discard local changes, I will use git checkout. When
the repo is small, I might even run “git clone,” then git checkout.
[Undo public changes] When the changes have been pushed yet
$ git log -n 5
$ git revert $git_revision
$ git push origin $branch_name