I've done this before by creating a clone and doing the rebase in the clone, but I suspect I could do it safely on a separate branch.
I have a feature branch feat-x with about 25 commits on it. I'd like to (safely) squash several of these together.
(I say "safely" because the first couple of times I squashed I didn't get it right -- but was working in a clone so just threw it away until I figured out the right incantation.)
What sequence of commands will give me feat-x-exp that is a copy of feat-x so I can experiment with squashing without disturbing feat-x?