How to remove a file from the previous commit?
There can be times when you would want to remove a specific file or part of the code from your last commit.
There can be times when you would want to remove a specific file or part of the code from your last commit.
Despite all the fixes you try, faulty commits do occasionally make it into the central repository. Still this is no reason to despair, since git offers an easy way to revert single or multiple commits.
Initially, when I started working on git, I was terrified of squashing commits, I always feared that I will do it wrong and will lose some code, but it's very simple once you understand the underlying logic.
Making ammends is easy when you know the right command to do it.
Move between differen branches is a little tricky if you don't remeber all the steps, but you can always bookmark this page for it.