random things to make git work for you
export PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
git add --patch
git rebase -i
- Shuffle around commits to a more meaningful order
- "squash" commits together
- Change commit messages
- ...
git reflog
This gives you an "out-of-band" history of every revision your local repo has been in. If a merge goes bad, or you accidentally overwrite a commit, bad rebase, etc. you can always get back to the last state.
It's not that magical; think about it as BEGIN / QUERY / COMMIT for version control.