0

so I followed the instruction to remove my last 4 commits at : How to revert Git repository to a previous commit?

After I do git reset --hard 0d1d7fc32

my git log does not show the last 4 commits but when I try to commit, it doesnt update my github

it says : $ git commit . On branch master Your branch is behind 'origin/master' by 4 commits, and can be fast-forwarded. (use "git pull" to update your local branch)

nothing to commit, working directory clean

how do i update my github so my last 4 commits are gone?

Community
  • 1
  • 1
resultsway
  • 12,299
  • 7
  • 36
  • 43

1 Answers1

1

so my last 4 commits are gone?

git push origin master --force

It's not what you normally would like to do, but every tool is just a tool.

What this will do - it will move the origin/master branch pointer to the 0d1d7fc32.

zerkms
  • 249,484
  • 69
  • 436
  • 539