git branch -f X origin/X
See : http://stackoverflow.com/questions/5667884/how-to-squash-commits-in-git-after-they-have-been-pushed
- run the commit
- run interactive rebase
git rebase -i origin/checkerror~1 checkerror
keep first pick use fixup for the other...
- push to github
git push origin +checkerror
http://stackoverflow.com/questions/8134960/how-to-revert-master-branch-to-upstream
git checkout master
git remote add upstream "https://github.com/xx/yyy"
git remote update
# the double hyphen ensures that upstream/master is
# considered as a revision and not confused as a path
git reset --hard upstream/master --
OR
git reset --hard (TAG)
git push origin +master
$ git fetch --all
$ git branch MYBRANCH origin/MYBRANCH
$ git checkout MYBRANCH