Introduction
Sometimes you want to change the order of your recent work steps in Git to make your history cleaner or fix mistakes. Reordering commits lets you rearrange these steps before sharing your work with others.
When you want to group related changes together before pushing to a shared repository
When you accidentally committed changes in the wrong order and want to fix it
When preparing a pull request and want a logical sequence of commits
When cleaning up your commit history to make it easier for others to review
When you want to squash or reorder commits to simplify the project history