0

The popular question about reverting gives great answers for either reverting normal commits, or for reverting one merge commit. But gives no help for figuring out how to revert arbitrarily far back in the log, when the history consists of a "random" mix of commits and merge commits (which is not unusual when working collaboratively). Invariably when trying to revert such a history, I run into the "commit X is a merge" error:

git revert --no-commit 7512836..HEAD
error: commit 43745cc8a5e462a2f20940a4d9866d143995b3da is a merge but no -m option was given.
fatal: revert failed

So how do I actually, simply, revert back to where-ever I want to go, without special commands for each commit depending on whether it is a merge or a normal commit?

Anonymous Entity
  • 3,254
  • 3
  • 27
  • 41
  • You've tried one of the options in that question, what about the others? – Liam Jul 21 '21 at 10:56
  • [*how do I actually, simply, revert back to where-ever I want to go*](https://stackoverflow.com/a/12049323/542251) – Liam Jul 21 '21 at 10:58
  • No it does not answer my question. Because the `git revert hash..hash` fails if anything in between is a merge. – Anonymous Entity Jul 21 '21 at 11:28
  • https://stackoverflow.com/search?q=%5Bgit%5D+revert+merge+but+no+%22-m%22+option+was+given. – phd Jul 21 '21 at 12:16

0 Answers0