Plot: I have a local develop and master branches. develop has around 90 commits ahead of master, spawning from ~6 months back.
I ran a git filter-branch -f --index-filter 'git rm --force --cached --ignore-unmatch media/*' -- --all command that rewrote more of git's history than I was expecting, on both branches. This, because of what the command does, actually made a gazillion git operations, which left my git reflog useless.
I recovered the master branch easily with a simple git reset --hard origin/master, but my develop branch is in a really bad shape.
Now, obviously, the commits hashes between master and develop don't match, which makes git think that I have a gazillion commits to push and a gazillion commits to pull from/to my remote/develop (there should be 0 commits to pull, ~90 commits to push)
Is there a way I can make git "reconcile" all the commits from master and develop? It should be something like:
for commit in commits_in_master:
tmp = search_by_commit_autor_and_date_and_message_in_develop(commit)
tmp.hash = commit.hash
tmp.save()
Edit:
If what I'm asking is not possible, can I (somehow) extract only the ~90 commits that weren't pushed to origin/develop, then git reset --hard origin/develop my develop branch and then apply those ~90 commits?