I would check the commit before the crushed commit, create a branch and merge your uncommitted commits.
Then git cherry-pickthe commit range from your old story on top of this new branch.
Something like the following.
B' = squashed b2
A B' C D
dev - - * - - * - - * -- *
dev2 \ - - * - - * - - *
b1 b2 b3
Step 1 & 2: `git checkout <sha-A> && git checkout -b d3 && git merge dev2`
A B' C D
dev - - * - - * - - * -- *
d3 - - * - - b1 - - b2 - - b3
Step 3: `git cherry-pick <sha B'>..dev`
d3 - - A - - b1 - - b2 - - b3 - - C - - D
The above actions do not destroy your current branches.
source
share