我没有提交文件,而是在GitHub应用中点击“同步” [英] Instead of Committing Files, I hit 'Sync' in GitHub app

查看:328
本文介绍了我没有提交文件,而是在GitHub应用中点击“同步”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

然后哪个Git将我的存储库(不是github)中的文件同步(覆盖)到我的本地文件。我已经失去了整整一天或更多的工作。

有没有办法恢复发生的事情?发生了什么?
我是我自己的一方。



Rich

解决方案

如果应用程序隐藏了更改而不是删除它们,您将能够恢复它。试试这个:

  git存储列表

希望你会得到一个输出 stash @ {0}:... ,应该很容易用下面的方法恢复:

  git stash apply 



<但是,如果存在多个存储,您需要调用:

  git stash apply stash @ {number} 

如果比较复杂,请查看 docs for stashing。

注意,如果没有隐藏,变化消失了。永远。如果你没有一个保存修改或者备份的编辑器,那么我认为你不能做任何事情。


Which Git then proceeded to sync (overwrite) files from my repository (not github), to my local files. I have lost an entire day or more of work.

Is there a way to revert what happened? What did happen? I am side myself.

Rich

解决方案

If the application stashed the changes instead of removing them you will be able to restore it. Try this:

git stash list

Hopefully you'll get an output stash@{0}: ..., which should be easily restored with:

git stash apply

However if there is more than one stash you'll need to call:

git stash apply stash@{number}

If it's more complicated, look into docs for stashing.

Note that if there's no stash, the uncommited changes are gone. Forever. If you don't have an editor that preserves changes or has some backups then I don't think there's anything you can do.

这篇关于我没有提交文件,而是在GitHub应用中点击“同步”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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