Asked about When something goes wrong in git

What is the difference between reset and revert?

An answer that works

Reset moves the branch pointer back, rewriting history, which is fine for local commits. Revert makes a new commit that undoes an earlier one, keeping history intact, which is what you use on shared branches.

Reading an answer is not being able to give one. The section that teaches this is When something goes wrong in git, 3 hours of Git & collaboration.

Learn this properly