Well... comment conversation may have presented the user with a solution, but the question wasn't answered and the conversation raises more questions, so here are some things:
First of all, if you want to enter the commit message for a revert on the command line, you can say
git revert -n -m 1 <hash>
git commit -m "RM:000 Reverted"
Adding the -n
option tells revert
not to automatically commit. It also means that if you revert multiple commits at once, the undo changes are combined into the index, so when you do manually commit they will all be squashed together. Maybe that's what you want, maybe not; in this case, it's just one commit, so it doesn't matter.
That said, you might want to either familiarize yourself more with the vi
editor, or change your git config to use an editor with which you're more comfortable. You can set the core.editor
config value or the environment variable GIT_EDITOR
to specify a command for git
to run when it needs to show you an editor.
Lastly, as pointed out in the comments, undoing a merge that has been pushed is a very difficult thing; every solution has negative consequences.
You can revert the commit, as you are trying to do. This is good in many ways, but it leaves git thinking that the branch has been merged and accounted for, even though its changes have been undone. So if you want it later, you have to do one of two things:
1) You can "revert the revert"
2) You can do a rebase -f
on the branch before merging; this causes the branch to be rebuilt from new commits that git won't think are "already accounted for".
You can read more about these techniques in numerous articles and SO answers.
The other option is to use git reset
to remove the merge from the branch history. This has all of the consequences of rebasing a branch after sharing it, so see the git rebase
documentation under "recovering from upstream rebase" (or search for questions about force pushing, as many of them will spell this out).