Using git I made something like this
git clone
git checkout {a rev number tree rev before} (here I started to be in a detached head state)
//hacking
git comm
Maybe not the best solution, (will rewrite history) but you could also do git reset --hard <hash of detached head commit>
.
An easy fix is to just create a new branch for that commit and checkout to it: git checkout -b <branch-name> <commit-hash>
.
In this way, all the changes you made will be saved in that branch. In case you need to clean up your master branch from leftover commits be sure to run git reset --hard master
.
With this, you will be rewriting your branches so be sure not to disturb anyone with these changes. Be sure to take a look at this article for a better illustration of detached HEAD state.