I've accidentally cloned (or pulled, I don't remember) another repo into my project repo, and now I see something like +1500 foreign commits, starting from year 2011. I don't know how to simply revert it, because these commits are braided into mine.
Good thing is I haven't pushed it yet, but I have some changes in my work which I would like to preserve. How can I do this?
@edit The accepted answer doesn't preserve my work, but it can be simply solved by following these steps: move the modified files into some safe place → revert → move them back into reverted repo → make a new commit out of them.