Interview Prep/Git & GitHub/Undoing changes: reset, revert, restore and reflog

What is the difference between `git reset` and `git revert`?

BeginnerConceptUndoing changes: reset, revert, restore and reflog
Answer

reset moves the branch pointer backwards and rewrites history, which is fine locally but disruptive on shared branches. revert adds a new commit that applies the inverse of an earlier commit, so history stays intact and it is safe on pushed branches.

git revert abc1234
git revert HEAD~3..HEAD
All Git & GitHub questions Roadmap: Git & GitHub

More on Undoing changes: reset, revert, restore and reflog