Before a risky rebase I like a backup of the branch. git branch -c makes one that also keeps the branch’s settings.
git branch -c feature feature-backup
-c copies the branch, its reflog and its configuration. That last part is the difference with a plain git branch feature-backup feature, which only creates a new pointer at the same commit. After -c, the copy has the same upstream:
$ git config --get-regexp '^branch\.feature-backup'
branch.feature-backup.remote origin
branch.feature-backup.merge refs/heads/feature
With only one name, it copies the current branch: git branch -c feature-backup. You stay on the original branch.
Then rebase away. If it goes wrong, git reset --hard feature-backup on the original brings everything back, and git branch -D feature-backup removes the copy when you’re happy. The reflog would save you too, but a named branch is easier to find.
Because the copy tracks the same remote branch, a careless git push from the copy could try to push to feature on the server. With the default push.default=simple, git refuses since the names differ, but I’d still remove the upstream from a backup with git branch --unset-upstream feature-backup.
Further reading: git-branch documentation