git filter-branch
is a very powerfull command that leads to a lot of pitfalls if is not used correctly. One of those pitfalls is that it you can easily rewrite your git history, as in your case.
Can you recreate the original git history?
What you can maybe do to recover your original history is:
Use git reflog
to find an old commit before the rewrite and then reset with git reset --hard <commit>
.
Check for backup refs: git log refs/original/refs/heas/main
.
For more information you can read these links:
https://git-scm.com/docs/git-filter-branch
https://www.atlassian.com/git/tutorials/refs-and-the-reflog