xxxxxxxxxx
# for the most recent commit
git commit --amend -m "changed commits"
git push -f
# for n older commits (grbi HEAD~n)
git rebase -i HEAD~n
# follow instructions until satisfied (grbc)
git rebase --continue
# solve conflicts if exist (gpf)
git push -f
# git push --force-with-lease origin <branch> is safer
xxxxxxxxxx
# Displays a list of the last 3 commits on the current branch
$ git rebase -i HEAD~3