[英]How to go back to latest commit after seeing old stash
我應用了一個存儲,然后進行了幾次提交。 在那之后,我決定再次快速查看一下藏匿處。 所以我輸入:
git stash apply stash@{0}
我只是想看,什么也沒做。 現在,我只想回到我的最新提交。 當我做
git checkout master
它給出錯誤信息
error: you need to resolve your current index first
test.js: needs merge
因此,在這種情況下,如何返回到我的最新提交? 我也想知道如何以正確的方式檢查舊的藏匿處。
使用以下命令反向應用存儲:檢索存儲補丁並反向應用
git stash show -p stash@{0} | git apply -R
或嘗試
git reset --merge
,看看是否可以從新狀態恢復。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.