I have a hard time removing a single line containing some sensitive information from an earlier commit.
Lets say my git log looks like the following
b200bbe (HEAD -> master) A
67a8df7 B
47a6947 C
a55540f D
68b51d5 E
And now I see in one of my testfiles I've created a debug line printing out some sensitive information at the time of commit E
If I just remove the line and commit the change people would be able to see the line if browsing the file at the time between commit E and the new commit.
There are multiple articles explaining how to remove a complete file from the git tree but I can't see to find a way to only remove one line. filter-branch --tree-filter
seems to be the closest however I still end up with changes that I need to commit and a git diff would expose the line that got removed from the command.
None of the commits have been pushed yet and no branches have been made since commit E. Is it possible to remove a single line in a file from the complete git tree?