简体   繁体   English

如何将一次提交中的所有文件还原到以前的版本?

[英]How to revert all files in a commit to a previous version?

Firstly I'd like to say I'm sorry to ask this kind of question, but I've been researching to the past hour on how to do this without success (maybe there is no way?) 首先,我想说我很抱歉提出这样的问题,但是过去一个小时我一直在研究如何成功地做到这一点(也许没有办法?)

I know how to revert a file or a folder to a previous commit, but my issue here is that I want to revert all files that were committed on a specific commit. 我知道如何将文件或文件夹还原到以前的提交,但是我的问题是我想还原在特定提交上提交的所有文件。

Is there? 在那儿?

Kind regards and thanks in advance 亲切的问候和预先的感谢

edit - 编辑-

Silly me, I knew there was an easy way to do that. 愚蠢的我,我知道有一个简单的方法可以做到这一点。 git revert was what I needed. git revert是我需要的。 Just misunderstood how it worked. 只是误解了它是如何工作的。

Looks like what you need is to rever the problematic commit altogether. 看来您需要的是完全尊重有问题的提交。 use git revert then, it will create a new commit with exactly opposite changes to the selected one, 然后使用git revert ,它将创建一个新提交,其更改与所选更改完全相反,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM