Cancel lame commit¶
Imagine you make lame commit. Now to repair things do next:
- git reset HEAD~1 –soft
- git status
You will see: Your branch is behind ‘origin/8.0’ by 1 commit, and can be fast-forwarded. (use “git pull” to update your local branch)
- git add // Add here changed (fixed) files
- git diff –cached //make sure everything is ok.
- git status
You will see: Your branch is behind ‘origin/8.0’ by 1 commit, and can be fast-forwarded. (use “git pull” to update your local branch)
- git commit -m’I fixed my mistakes’
- git status
You will see: Your branch and ‘origin/8.0’ have diverged, and have 1 and 1 different commit each, respectively. (use “git pull” to merge the remote branch into yours)
Now finaly force is with you:
- git push origin 8.0 -f