Rewriting branches is too dangerous -> you need a useful tool
- reset is not limited to rewriting history. If you want to roll the online version back to a precise commit state:
- Checkout history submission first
- Then reset mixed to HEAD and do another commit
- This commit contains the revert of all changes between the two.
git checkout [historical commit record] # Back to the historical version
git reset --mixed [branch] # Bring the historical version to the HEAD
git checkout [branch] # Switch back to the branch
git commit # Submit the historical version and the revert diff of HEAD