How to push a new local branch to a remote Git repository

git push -u origin new-branch git fetch origin git checkout --track origin/new-branch

How to change last commit message if pushed by mistake

git reset --soft HEAD^ or git commit --amend git commit -m "New message" git push -f