在Git历史中间撤销提交 [英] undo commit in middle of Git history

查看:125
本文介绍了在Git历史中间撤销提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用<$>来取消单个被推送的提交,它在git历史记录的中间,即它不是最近的提交。 c $ c> git revert<提交哈希> , git cherry-pick ,或其他?


<解决方案使用 git revert< commit hash> git cherry-pick 用于当您要重做提交时。

I want to undo a single pushed commit that's "in the middle" of the git history, i.e. it's not the most recent commit.

Should I use git revert <commit hash>, git cherry-pick, or something else?

解决方案

Use git revert <commit hash>. git cherry-pick is for when you want to redo a commit.

这篇关于在Git历史中间撤销提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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