I have a 3 month old commit, lets say commit A which touchs 3 files Over the last 3 months, a lot more commits have gone in, some of which have added new code below changes from commit A
I want to remove (not revert) the changes from commit A in 1 of the 3 files.
remove as in blank line instead of code
I tried
this removes extra code (which is outside the scope of commit A: details below if interested)
One way i can think of is using git blame on file, wherever hash matches, remove the lines but seems to be very iterative process and time consuming.
Any pointers would be helpful..
Thanks in advance
Extra code removed from file which is out of scope of commit A:
I would still try git-revert to remove lines in commit A.
Next you want to restore the other two files which don’t need revert. git checkout HEAD^ - file1 file2
is the way to recover to the original file content.
Finally commit amend to overwrite nicer message than “Revert …”