I accidentally committed a change in a file that does not relates to my current branch and I need to remove this change from my commit history.
This is the file I want to remove fom my history:
How can I achieve this?
I accidentally committed a change in a file that does not relates to my current branch and I need to remove this change from my commit history.
This is the file I want to remove fom my history:
How can I achieve this?
Do you simply want to remove the changes that the commit introduced? In that case use
git revert SHA
This will introduce a new commit without the changes from the particular commit you did not want.
If you have not pushed the commit so far you can also completely remove it from the history via:
git rebase -i