Undoing Things and saving your Neck with Git | Tobias Günther

Learn advanced Git techniques to recover from mistakes, manipulate commit history, and improve collaboration with Git reflog, reset, rebase, and more.

Key takeaways
  • Git reset --hard and --mixed are used to undo local changes.
  • git reflog is used to view the commit history and recover deleted commits.
  • git rebase is used to manipulate the commit history, and git interactive rebase is used to squash and reorder commits.
  • git fix up is used to combine multiple commits into one.
  • Use git amend to modify the last commit.
  • Use git revert to undo a commit without changing the history.
  • Use git checkout to switch branches and git branch to create a new branch.
  • git reset is used to reset the branch to an earlier state.
  • Use git commit --amend to modify the last commit.
  • Use git add and git commit to stage and commit changes.
  • The --mixed option is used to keep changes as local changes.
  • git rebase is used to rewrite the commit history.
  • Use git interactive rebase to squash and reorder commits.
  • Use git fix up to combine multiple commits into one.
  • Use git amend to modify the last commit.
  • Use git reset to reset the branch to an earlier state.
  • Use git cherry-pick to apply a commit from another branch.
  • The reflog is used to view the commit history.
  • Use git revert to undo a commit.
  • Use git interactive rebase to squash and reorder commits.
  • Use git fix up to combine multiple commits into one.
  • Use git amend to modify the last commit.
  • Use git reset to reset the branch to an earlier state.