Git恢复未提交的更改 [英] Git recover uncommitted changes

查看:658
本文介绍了Git恢复未提交的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多本地修改。



c $ c> git merge another_branch
git reset --hard HEAD ^

工作的。 :(意图我不想在这里合并的变化。

如何恢复原始状态?



不,本地更改从未提交/存储过。



没办法?

解决方案

如果更改从未被提交/隐藏/暂存,那么你运气不好,如果他们有,那么你应该能够通过在 git reflog


I had a lot of local changes.

I just accidentally did

git merge another_branch
git reset --hard HEAD^

on a lot of work. :( with the intention I didn't want the merged changes in here.

How do I recover the original state?

No, the local changes were never committed/stashed.

No way?

解决方案

If the changes had never been committed/stashed/staged, then you're out of luck. If they have, then you should be able to git your changes back by looking for them in git reflog.

这篇关于Git恢复未提交的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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