My git cheatsheet

Redo latest commit

$ git reset HEAD~ Keep changes but unstage them.

$ git reset --soft HEAD~ Keep changes and still have them staged.

$ git reset --hard HEAD~ Discard changes entirely.

.gitignore

Link

git rm -r --cached <file/dir> Remove file that is included but later added to gitignore.