We\'ve done something bad.
We ran git stash save
during a merge conflict, and now we can\'t restore our work.
Things we\'ve tried:
g
Given your last comment : you can use
git stash megre --no-commit
to put the index in a "merge" state without committing the changes
then modify it with what you want :
if you have already worked out your merge in the stash :
git reset #to remove the "conflicts" flags
git checkout -- ./ #to revert everything to the previous working state,
git stash apply #apply your changes
and once everything is in the desired state, git commit
About bukzor's comment : there is actually a big difference between git checkout
and git checkout
.
From the reference on git checkout :
git checkout
: This form switches branches by updating the index, working tree, and HEAD to reflect the specified branch or commit.
git checkout [-p|--patch]
: When
git checkout
would indeed discard the merge informations.
git checkout
(note the extra -- ./
), on the other hand, will keep the merge information, and revert every tracked file to its state in
.