From there I did not know how to get back to a clean history.
Depending what you did, one of these would probably help:
* `git rebase --abort` if you messed up rebase. * `git merge --abort` if you messed up a merge. * `git reset --hard <commit spec>` to go back to a specific commit.