git checkout -b branch
for sanity, clarity, and posterity
git rebase -i master
Alter each commit according to the following options:
If you "Squash" (ˈskwëtch), an editor will open:
If you mess up the rebase, you can always
git rebase --abort
and begin again
git log --graph --pretty=format:'\''%Cred%h%Creset %C(cyan)%an%Creset -%C(blue)%d%Creset %s %Cgreen(%cr)%Creset'\'' --abbrev-commit
git log 311b73b
git reset HEAD~
will unstage all files from a commit while keeping all the code changes.