Is there a way to remove changes to a collection of committed files?

12 Views Asked by At

I have a PR on Github that has changes to Files A, B, C, D, E, F and G in it. I want to remove the changes I've made to files B, C, D and E. Is there an easy way to do it without manually going in and removing the differences via file compare?

Ideally, I'd want some kind of checklist where I could tick the files I want to revert the changes back to what they were before I changed anything

1

There are 1 best solutions below

0
On

You can use the undo commit action without auto-commit. Then you can only commit the files you want to keep as modified from your previous commit

git revert <commit hash>