git reset HEAD~
git rm -r --cached path/ignore/dir
git reset HEAD^
git branch -m [old_name] new_name
git rebase --onto <new-parent> <old-parent>
Say the history is
git log --pretty=oneline
a931ac7c808e2471b22b5bd20f0cad046b1c5d0d c
b76d157d507e819d7511132bdb5a80dd421d854f b
df239176e1a2ffac927d8b496ea00d5488481db5 a
That is, A was the first commit, then B, and finally C.
Running git rebase --interactive HEAD~2
gives you an editor with
pick b76d157 b pick a931ac7 c
Changing c's pick to squash will result in the commit merging with it's predecessor
pick b76d157 b squash a931ac7 c
and save-quitting your editor, you'll get another editor. When you save and quit, the contents of the edited file become commit message of the new combined commit.
export EDITOR=vim
git pull --rebase origin master
git checkout -b <branch_name> <commit>
git reset --hard COMMIT_ID
git branch -d branch_name
git reset --soft HEAD@{1}
commit properly
grep -lr '<<<<<<<' . | xargs git checkout --theirs
git add .
git rebase --continue
git rebase -p --onto SHA^ SHA
find . -name "*" -type f -exec dos2unix {} \;