我怎样才能在Git中恢复丢失的提交? [英] How can I recover a lost commit in Git?

查看:123
本文介绍了我怎样才能在Git中恢复丢失的提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,通过3次提交得到你的分支在3次提交之前是原点/主人,然后我的应用程序已经恢复到较早的更早的时间。



我怎样才能得到我过去11个小时做的事情? >

git reflog 是你的朋友。找到你想要在那个列表中提交的提交,你可以重置它(例如: git reset --hard e870e41 )。

(如果您没有提交更改......您可能会遇到麻烦 - 提早提交并经常提交!)


First, got "your branch is ahead of origin/master by 3 commits" then my app has reverted to an earlier time with earlier changes.

How can I get what I spent the last 11 hours doing back?

解决方案

git reflog is your friend. Find the commit that you want to be on in that list and you can reset to it (for example:git reset --hard e870e41).

(If you didn't commit your changes... you might be in trouble - commit early, and commit often!)

这篇关于我怎样才能在Git中恢复丢失的提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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