Vithursa Mahendrarajah
Vithursa Mahendrarajah

Reputation: 1224

Github - reverting a pull

I am working on a repository forked from another public repo. Recently I did a git pull from origin. Now I want to remove the latest pull that I made. I executed the command

git reset --keep HEAD@{1}

After that, when I tried to push, It says that

Your branch is behind 'origin/branchName' by xx commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Do I need to remove pull from remote as well? If so how could it be done? Please explain.

Upvotes: 1

Views: 74

Answers (1)

Johnny Chia
Johnny Chia

Reputation: 102

If what you really want to is to push no matter that the branch is ahead. You don't really need to delete the commit, You can just use force push.

git push origin --force

Upvotes: 2

Related Questions