Git has an excellent tool designed to help you reorder the commit history: interactive rebase. This can be excellent if you want to keep the history clean, so that it helps other programmers understand the logic behind the changes rather than the actual sequence of commits. Let’s walk through an example. Let’s write some history Let’s start by creating an empty project in a new directory: $ git init . Let’s create a simple program with an editor: