有什么办法可以撤销“git revert head”的效果吗? [英] Is there any way to undo the effects of "git revert head"?

查看:636
本文介绍了有什么办法可以撤销“git revert head”的效果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心在我的仓库中运行了错误分支的命令 - 有没有办法来取消这个改变?

I've accidentally run the command against the wrong branch in my repository - is there a way to undo this change?

推荐答案

< > git revert 只是创建了一个新的提交 - 您可以用 git reset --hard HEAD ^ (不过要小心点!)

git revert just creates a new commit -- you can "remove" it with git reset --hard HEAD^ (be more careful with it, though!)

这篇关于有什么办法可以撤销“git revert head”的效果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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