2

I have made some changes to a number of conflicting files as the result of a a git pull command, using the git mergetool command, but I want to revert it back to the state before I made the changes with the mergetool.

It is basically the state where git warns that there are conflicts and lists them. What command is required for that?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
vfclists
  • 19,193
  • 21
  • 73
  • 92
  • Take a look here: https://stackoverflow.com/questions/14409420/restart-undo-conflict-resolution-in-a-single-file – Daniel Rose Aug 05 '22 at 13:39

1 Answers1

6

I'm not sure if there is actually a way to "simulate" a merge and view its conflicts. However, you can certainly run the merge, view the conflicts, and immediately undo it using:

git reset --merge

For v1.7.4 and later, you can also use:

git merge --abort
Wes Foster
  • 8,770
  • 5
  • 42
  • 62