gpt4 book ai didi

git - 意外 checkout 后取回更改?

转载 作者:IT王子 更新时间:2023-10-29 00:40:33 24 4
gpt4 key购买 nike

以下是我的 repo 协议(protocol)的状态。

[~/rails_apps/jekyll_apps/nepalonrails (design)⚡] ➔ gst
# On branch design
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: _layouts/default.html
# deleted: _site/blog/2010/04/07/welcome-to-niraj-blog/index.html
# deleted: _site/blog/2010/04/08/the-code-syntax-highlight/index.html
# deleted: _site/blog/2010/05/01/showing-demo-to-kalyan/index.html
# deleted: _site/config.ru
# deleted: _site/index.html
# deleted: _site/static/css/style.css
# deleted: _site/static/css/syntax.css
# modified: static/css/style.css
#
no changes added to commit (use "git add" and/or "git commit -a")

我不小心做了 git checkout -f,现在我不应该做的更改都消失了。

[~/rails_apps/jekyll_apps/nepalonrails (design)⚡] ➔ git co -f
[~/rails_apps/jekyll_apps/nepalonrails (design)] ➔ gst
# On branch design
nothing to commit (working directory clean)
[~/rails_apps/jekyll_apps/nepalonrails (design)] ➔

我可以取回更改吗?

最佳答案

您可以查看的另一件事是通过您的 IDE。我不小心检查了 2 个文件,并且能够通过我的 IDE (Netbeans) 的“本地历史记录”恢复更改。多么幸福啊!

如果您使用的是 Eclipse,请右键单击该文件并转到团队 -> 显示本地历史记录。

关于git - 意外 checkout 后取回更改?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2961240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com