For example, let's say that there was a conflict during a merge into master, like this.
A --- M <- master
/
B -
Sometimes I find out that the conflict, or the commit B was too messy (for example, crlf changes on all files) so I decide to reset the file status to A and modify feature specific files only. (i.e. write M from scratch.)
However, if I do git reset --hard .
, the files are resetted but also the MERGE_HEAD is deleted afterwards, making it impossible to create a merge commit.(fatal: There is no merge in progress (MERGE_HEAD missing).
)
How can I reset all files while perserving MERGE_HEAD?