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 properlyAlso asked about Git & collaboration
What is a branch in git?What is the difference between git reset --soft, --mixed and --hard?What is the difference between merge and rebase?How do you undo a commit that is already on the shared branch?How would you find which commit introduced a bug?Why not commit model weights to git?You pushed an API key to a public repository. What do you do?