Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Git FAQs

Undo the last local commit

git reset HEAD~

Undo Uncommitted or Unsaved Changes

Unstage all the files you might have staged with git add:

git reset

Revert all the local uncommitted changes. Execute in the repo root:

git checkout .

Delete the repo’s branches

Get all the repo’s branches except for branch master and delete these:

git branch | grep -v master | xargs git branch -D