Timeline for How can I revert multiple Git commits?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 13, 2022 at 13:20 | comment | added | homiak | That's the best answer in cause you have merge commits in the list of commits you want to revert. | |
May 14, 2022 at 19:49 | history | edited | Peter Mortensen | CC BY-SA 4.0 |
Word order, etc.
|
Apr 19, 2022 at 22:06 | comment | added | mcarans | Nice! This is simpler than my long handed approach which was to clone the repository again, check out the specific good commit in MyRepo2, then use a file compare tool to see what files changed between MyRepo and MyRepo2, then copy the changed files from MyRepo2 to MyRepo. | |
Jun 1, 2021 at 14:55 | comment | added | Redar | Using this command you don't have to worry about merge commits. Very useful | |
Nov 11, 2020 at 16:14 | comment | added | confirmator | This helped me out with reverting a whole batch of commits which were already pushed to the remote - great solution! | |
Oct 12, 2020 at 17:17 | history | edited | rogerdpack | CC BY-SA 4.0 |
make more universal
|
Feb 17, 2020 at 12:20 | comment | added | Somebody | Wow cool, just what i was looking for. So it's reverse diff and then applying these changes over existing code. Very clever, thank you. ;) | |
Aug 22, 2018 at 0:10 | comment | added | Juliusz Gonera |
This will work even if you want to revert a range of commits that contains merge commits. When using git revert A..Z you'd get error: commit X is a merge but no -m option was given.
|
|
Jan 3, 2018 at 14:25 | comment | added | weinerk |
re: binary files use --binary option: git diff --binary HEAD commit_sha_you_want_to_revert_to | git apply
|
|
Sep 29, 2017 at 13:57 | comment | added | Brian Kung | This is a much more flexible solution than the accepted answer. Thanks! | |
Jul 10, 2017 at 19:16 | comment | added | GabLeRoux |
Won't work with binary files: error: cannot apply binary patch to 'some/image.png' without full index line error: some/image.png: patch does not apply
|
|
Sep 9, 2014 at 13:13 | history | answered | mateusz.fiolka | CC BY-SA 3.0 |