1

I merged some bad files 2 commits ago. I wish to bring my branch back to the state it was at the 3rd last commit.

I have looked up the commit hash and tried:

git revert 112233445556etc but get the error:

error: Commit 112233445556etcis a merge but no -m option was given. fatal: revert failed

I can't seem to find any information on Google, apart from git revert.

Would anyone know of the correct way to do this?

bahrep
  • 29,961
  • 12
  • 103
  • 150
MeltingDog
  • 14,310
  • 43
  • 165
  • 295

1 Answers1

-1

git checkout HEAD~3 would let you revert back to three commits ago. You are currently on HEAD and HEAD~n takes you back n commits. or in your case you know the commit-id so you can do a git checkout 112233445556etc

OLIVER.KOO
  • 5,654
  • 3
  • 30
  • 62