I accidentally dropped all prior Git history from a clone of a third-party maintained "SOME_TEMPLATE" repo when I began adding my own custom code (my "CUSTOM" repo).
The recommended way to use SOME_TEMPLATE is to clone it (with history), add your custom code, then periodically re-merge in the desired new changes from the regularly-updated SOME_TEMPLATE.
So to get back in sync with the SOME_TEMPLATE repo, I need to re-apply my code changes (100 commits) to a fresh copy of the SOME_TEMPLATE repo ... but first "rewind" the SOME_TEMPLATE back to the same commit it was on when I started adding my code.
SOME_TEMPLATE currently has 1000 commits. It was on commit #950 when I started adding my code (and when I accidentally dropped all the old history).
My CUSTOM code added 100 commits.
So I think I need to do something like this:
- make a fresh clone of SOME_TEMPLATE (with the git history this time), call it "REDO".
- somehow drop the last 50 commits in REDO so it's re-wound back to commit #950 (which is where I started adding my code)
- somehow re-add my same 100 commits from my CUSTOM repo to the new, corrected REDO repo. (So when done the HEAD of REDO has the exact same code as the HEAD of CUSTOM, but REDO has all the old SOME_TEMPLATE history that I should not have dropped.)
If I do that, then I can start reviewing and merging the 50 new updates to SOME_TEMPLATE using their recommended merge/update process.
If absolutely necessary, I could probably "squash" my 100 commits down to one commit, to maybe make it easier to re-add all my changes to the REDO repo, but if there's a way to stack my 100 commits on top of commits 1-950 in REDO, that would be ideal.