我确实从分支中存储了git。如何在 git 存储之前获取我的文件?
git stash
git checkout other-branch
git stash pop
我以前没有救过他们。
如果您的意思是"我希望我的文件像运行初始git stash
之前一样":返回到您调用git checkout other-branch
之前所在的提交,然后重新应用存储
# clean your worktree :
git stash
# go back to the previous branch :
git checkout the/active/branch/before/other-branch
# apply the stash :
git stash pop
如果要多次"应用存储",可以使用git stash apply
而不是git stash pop
。
如果您的意思是:"我希望我的文件像我运行git stash pop
之前一样",只需重新存储内容:
git stash