失去了git存储变化 [英] lost git stash changes
问题描述
我在一个分支'A'上做了一个Git存储在那个分支上。然后我切换到另一个分支'B'。我导航回到分支'A',但没有做Git暗藏流行音乐。我切换到主分支,然后回到分支'A'。我试图去现在的混帐藏匿流行,但似乎无法得到我的变化回来..我需要恢复该代码,但每当我做一个混帐藏匿流行,我的文件更改不列出。我没有提交任何代码。
有没有办法恢复我所做的更改?真的很感谢在这方面的任何帮助。
通过
git存储列表
或
gitk --all
同样, git stash
不会隐藏未跟踪的文件。如果你这样做了,然后做了另一个分支的 git checkout --force
来覆盖另一个分支中跟踪的未跟踪文件,那么你已经丢失了那个内容。推荐使用的方式是使用
git stash -u
这将防止此类损失。
So here's what happened: I was on a branch 'A' and did a Git stash on that branch. Then I switched to another branch 'B'. I navigated back to Branch 'A' but did not do a Git stash pop. I switched to the master branch and then back to branch 'A'. I am trying to go a git stash pop now but cant seem to get my changes back.. I need to recover that code but whenever I do a git stash pop, my file changes are not listed. I did not commit any code.
Is there a way to recover the changes that I made? would really appreciate any help in this regards.
Stashes should be viewable via
git stash list
or
gitk --all
also, git stash
does not stash untracked files. If you did this and subsequently did a git checkout --force
of another branch to overwrite untracked files with tracked ones in another branch, you have lost that content. The recommended way to stash is with
git stash -u
This will prevent losses of this type.
这篇关于失去了git存储变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!