Chapter 7: Undo Changes

In git, we have different undo approaches for different scenarios.

It depends on what we need to do.

For example, if we want to

  • Amend last commit
  • Reset several commits
  • Revert changes after pushing to a remote branch
  • Rebase commits into another commit.