0

I want to revert a commit that was made by someone else. But I want the revert to be undone when I pull from remote next time. Meaning I don't even want it to be in the history when I pull and push next time. How can I do this?

Raj
  • 3,051
  • 6
  • 39
  • 57
  • 2
    Possible duplicate of [How to permanently remove few commits from remote branch](https://stackoverflow.com/questions/3293531/how-to-permanently-remove-few-commits-from-remote-branch) – Dherik Mar 01 '18 at 12:22
  • Do you want to vanish this commit only on your local machine, or do you want to remove it completely on the remote repo too? – Rudi Mar 01 '18 at 12:42

2 Answers2

1

Do a git revert on the commit you want to revert. Then before you do a pull, do a git reset --hard HEAD~1 assuming you're ahead of your remote tracking branch by one commit and that commit is the revert.

solstice333
  • 3,399
  • 1
  • 31
  • 28
0

On the latest version of the repo, use git log to find commit and then git checkout [COMMIT ID]

Similar question was asked here with a great answer: How to revert Git repository to a previous commit?

ibor
  • 1