The rather cryptic incantation to do that is is this command:

git rebase --onto <newbase> <upstream>
    
e.g.
    
git rebase --onto develop a2s4fx8

That will rebase the range of commits that are accessible from HEAD but not accessible from upstream. As a sanity check to verify the range, we can first run this command:

git log upstream..HEAD --oneline --graph

It will output the range that the rebase will target.

So, what is upstream?

Consider the following sentence in which This is HEAD and bunch is upstream.

This is a sentence with a bunch of words; each word represents a commit.

Running git log upstream..HEAD --oneline --graph would output this sentence:

This is a sentence with a