git reset HEAD^
# remove commit locally
git reset HEAD^
# force-push the new HEAD commit
git push origin +HEAD
git push origin +HEAD^:<name of your branch, most likely 'master'>
git commit --amend -m "New commit message"
Rename current branch:
git branch -m <newname>
Rename any branch:
git branch -m <oldname> <newname>
In addition to renaming local branch:
rem Push local branch and reset remote branch:
git push origin -u <newname>
rem Delete old remote branch:
git push origin --delete <oldname>
git clone --recursive --depth 1 -b master <repository url>
git log --pretty=format:"%h %ad [%an] %s" --date=short
git log -1
git submodule foreach "git stash list"