简体   繁体   中英

Undo changes after merged pull request

I have a branch development. I created a new branch X from it, and made some changes, then I created a new branch from X, branch Y, and in this branch I made big refactor of names of variables , like 30 files changed. After refactor I created pull request from branch Y to X, and merged it. Then i made some changes on branch X and then i created pull request and merged branch X to development. Can i undo branch Y, with these 30 files changed with refactor of names in it? If yes, how can I do it?

Demonstration:

示范图片

You could try reverting the commit in Y in which you did the renaming:

git revert <SHA-1 of Y commit

This should completely undo everything which happened in that Y commit, including the variable renaming.

To find the commit hash which you want to revert in development , one simple option would be to just use git log , which will show you a list of commits from most recent to earlier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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