Git Snapshot

To save a snapshot of your current work in git, try this command: git stash save "snapshot: $(date)" && git stash apply "stash@{0}" This saves your current work in a timestamped stash, without removing it. In Hashrocket’s dotmatrix this command is aliased to git snapshot.

May 8, 2015 · 1 min · Jake Worth

Undo a Git Mistake

git reflog is a record of your actions in Git. With this command, you can undo almost any Git mistake. $ git reflog 4bd0090 HEAD@{0}: <bad place> 46bd839 HEAD@{1}: <bad place> 967e214 HEAD@{2}: <last good place> 46bd839 HEAD@{3}: <good place> 967e214 HEAD@{4}: <good place> $ git reset --hard HEAD@{2}

April 21, 2015 · 1 min · Jake Worth