GitHub撤消放弃 [英] GitHub undo a discard

查看:469
本文介绍了GitHub撤消放弃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一些文件,并意外丢弃了github上的所有文件。我知道,只要你丢弃,底部就会有一个撤销按钮。但是我重新启动了我的gitub,现在我不再有撤消按钮了。有什么办法可以撤消丢弃并取回我的文件吗?我希望有,请让我知道,如果你有任何想法。



谢谢!

解决方案

放弃(您可以在后恢复已添加的文件以获取更多信息。



OP Benz_java 提到恢复丢失的提交信息,用于在reflog中查找丢失的提交信息。


I was working on some files and accidentally discarded all the files from github. I know that as soon as you discard there is an undo button at the bottom. But I restarted my gitub and now I do not have the undo button anymore. Is there any way I can undo my discard and get back my files? I hope there is, pls let me know if you have any ideas.

Thanks!

解决方案

The discard (that you can see in "Undo Button in GitHub for Windows") is available to reset files added to the index.

That means you added files, and reset them before any commit.

The GitHub for Windows/Mac won't help you there.

You need to recover those files from the git repo (git fsck --unreachable --no-reflogs --no-cache HEAD).
See "Recovering added file after doing git reset --hard HEAD^" for more.

The OP Benz_java mentions "restoring lost commits", for looking in the reflog for lost commit.

这篇关于GitHub撤消放弃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆