Useful Commands (Git) - notice-us-senpai/KouhaiDash GitHub Wiki

Create new branch and switch over to it: git checkout -b name_of_new_branch

Move changes in working directory from one branch to another:

git stash 
git checkout name_of_another_existing_branch 
git stash apply stash@{0} 
# use tab-completion when typing stash@{... 
# you may have stash@{1} and so on if you do not call clear 
git stash drop 

Archive branches in Git http://stackoverflow.com/questions/1307114/how-can-i-archive-git-branches

Undo local and unstaged changes https://githowto.com/undoing_local_changes

"Delete" a commit http://stackoverflow.com/questions/15772134/can-i-delete-a-git-commit-but-keep-the-changes

Totally nuke all other commits after some_commit and neither remain in that state nor see those again:

git reset --hard some_commit

Create a commit out of returning to a previous commit:

Below is what I did out of desperation to go back by 3 commits...

git revert latest_commit second_latest third_latest --no-commit
git add .
git commit

git cherry-pick (literally choose which commit to apply) https://git-scm.com/docs/git-cherry-pick