Git popup on main branch

I have two main masters and development. I hid on the host, for example.

git stash
git checkout development

Now I was on the development branch, but by mistake I pulled out a cache

git stash pop

And now it shows conflicts. I reset git using this:

git reset HEAD

But he still shows conflicts. I also need my stamp in the master branch. How can I fix this problem?

+4
source share
2 answers

git reset HEADwill not touch the working tree, just the index. In fact, this will lead to simple step-by-step files, because HEAD- this is where your current branch is already anyway (this is the definition of HEAD).

git reset --hard HEADwill fix the working tree to reflect HEAD.

a git pop , .

git -stash:

; . git .

:

git checkout master
git stash pop 
#or `git stash apply` if you don't want to drop the stash even if it does apply cleanly
+2

git , :

git stash --help

, , . , .

Recovering stashes that were cleared/dropped erroneously
   If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms. However, you can try the
   following incantation to get a list of stashes that are still in your repository, but not reachable any more:

       git fsck --unreachable |
       grep commit | cut -d\  -f3 |
       xargs git log --merges --no-walk --grep=WIP
+1

All Articles