git恢复到某个提交 [英] git revert back to certain commit

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

问题描述

 提交4a155e5b3b4548f5f8139b5210b9bb477fa549de 
如何将我本地副本上的所有文件还原为某个提交?作者:John Doe< Doe.John.10@gmail.com>
日期:Thu Jul 21 20:51:38 2011 -0500

这是提交我想回复到。任何帮助将是一个救星!

解决方案

git reset --hard 4a155e5 将HEAD移回到你想要的位置。如果您不希望任何内容指向您刚刚删除的历史记录,那么您可能需要先删除其他参考。


how do i revert all my files on my local copy back to a certain commit?

commit 4a155e5b3b4548f5f8139b5210b9bb477fa549de
Author: John Doe <Doe.John.10@gmail.com>
Date:   Thu Jul 21 20:51:38 2011 -0500

This is the commit i'd like to revert back to. any help would be a lifesaver!

解决方案

git reset --hard 4a155e5 Will move the HEAD back to where you want to be. There may be other references ahead of that time that you would need to remove if you don't want anything to point to the history you just deleted.

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

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