Imagine that you have committed several changes (in separate commits). For example, we have 3 commits: A , B and C.
Now, you have found out that in the commit B you have added a certain file (including some changes) that you shouldn’t have committed.
How would you remove that file in that commit?
An example would be great.
Thanks
This command will remove a file from all commits [from history].
Warning: If you’ve already shared your work with others, it’s not recommended to use this command. Please make sure you understood the full implications before using this command.