繁体   English   中英

Git 备份 git 存储

[英]Git backup git stash

我从分支做了 git stash。 如何在 git 存储之前获取我的文件?

git stash
git checkout other-branch
git stash pop

我之前没有保存它们。

如果您的意思是“我希望我的文件在我运行初始git stash之前保持原样”:go 回到您在调用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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM