Git Squash: How to Condense Your Commit History

Or you have a tight delivery of a very important feature, and you need to make sure everything is saved before signing out for the day. At first, it seems like nonsense, as we’re often told and taught that small atomic commits with clear commit messages seem to be the best way of going along. […]

Or you have a tight delivery of a very important feature, and you need to make sure everything is saved before signing out for the day. At first, it seems like nonsense, as we’re often told and taught that small atomic commits with clear commit messages seem to be the best way of going along. I strongly advise against drops and deleting lines, which will discard that commit (unless you’re really sure on what you want to do), and changing the order of the commits, since they will be reapplied in a different position than they were created.
Source: CloudBees