简体   繁体   English

如何将我的 git 远程分支恢复到 IntelliJ 中的先前提交?

[英]How to revert my git remote branch into previous commit in intelliJ?

I had already one PULL Request.我已经有一个 PULL 请求。 After rebasing my feature branch with the master I changed some files and commit it and pushed into my remote feature branch.在使用 master 重新设置我的功能分支后,我更改了一些文件并将其提交并推送到我的远程功能分支。 During push IntelliJ told me to rebase the local branch, I did it and resolved the conflict.在推送期间,IntelliJ 告诉我重新定位本地分支,我做到了并解决了冲突。 But after the next push, my pull request shows so many file changes and lots of commits, That I did not commit.但是在下一次推送之后,我的拉取请求显示了很多文件更改和大量提交,我没有提交。 How to get rid of this.如何摆脱这个。

I think the easiest solution would be to create another branch off of master (or whatever your PR is going into) and do a git merge --squash to make it a single new commit then restart your PR.我认为最简单的解决方案是创建另一个master分支(或您的 PR 进入的任何分支)并执行 git merge --squash以使其成为一个新提交,然后重新启动您的 PR。

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

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