resultsway
resultsway

Reputation: 13300

git revert and then how to update github?

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?

Upvotes: 0

Views: 91

Answers (1)

zerkms
zerkms

Reputation: 254886

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.

Upvotes: 1

Related Questions