COMP1531

7.5 - GIT - Resets & Amending

Mistakes

  • Everything we've done until this point continues to build on the git history. But we've largely considered the git history immutable.
  • With git, sometimes we make mistakes. Sometimes we want to undo things, or change history.

 

Two ways we're going to discuss this are:

  • git resets
  • git commit amend

 

 

git reset

 

git commit --amend

git commit --amend -m "Commit"

  • Sometimes we need to update our previous commit name. We can do that easily by making another commit that over-rides it.
  • Let's do a demonstration.

 

COMP1531 21T1 - 7.5 - Git - Resets, Amend

By haydensmith

COMP1531 21T1 - 7.5 - Git - Resets, Amend

  • 256