如何从特定提交中提取工作

问题描述 投票:1回答:1

我签出到先前的提交,然后不小心添加并提交了该提交,现在当我签出到dev分支时,我的工作消失了,我如何找回我的工作

enter image description here

我签出的提交显示为((741a ...),然后我git add。和git commit提交更改((5b78c ...)]

git github git-branch git-commit git-checkout
1个回答
0
投票

只需使用git reflog:这将为您提供切换分支之前的最后一次提交。

然后Cherry-pick表示使用git reflog提交到您当前的dev分支,作为seen here

git cherry-pick
© www.soinside.com 2019 - 2024. All rights reserved.