How to view only the unmerged files in git after a merge failure

git diff

This will only show failed merges after an unsuccessful merge. It has many options to configure what information you want to see. I suspect this is the exact option you are after:

 git diff --name-status --diff-filter=U

Also see and

Try this:

$ git ls-files -u
see man-git-ls-files

git --no-pager diff --name-only --diff-filter=U

But since the goal is most likely to edit those files, the following will do perfect:

vim $(git diff --name-only --diff-filter=U)

Thanks to @JHannes from another answer's comment