RickBacci
9/22/2015 - 8:44 PM

GitUndo.markdown

git revert

git log --oneline -4
git log --patch -3

git revert sha

get sha (at least 7 letters)

git ammend

git commit --ammend

git reset

git reset sha

git reset -- hard

wipes out history and files

will not affect untracked files will affect staged files

git reflog with show history of things that were deleted for a few weeks

git rebase git rebase (target) walks back to common ancestor and then roll forward

only do this if things arent pushed(public) git rebase -i master - (do this from a branch, and it will look like you did this after current master) git rebase -i origin/github-pages (safety net back to last thing that is not public)