Search code examples
gitgit-mergegit-merge-conflict

Git merge revert file to conflict mode


  1. I run git merge
  2. the Auto merge fails and I get conflict
  3. I change the file (to solve the conflict)

how to revert to 2 on a specific file without loss the other changed I make


Solution

  • To get the file into the original conflicted content after merge?

    git checkout -m -- path-to-file
    

    Don't know if git restore can do it as well.