user127819: I am aware this is related to this question. However, I am specifically curious about what would happen to the mining rewards, not the transactions, under a forking condition.

As shown in the picture. Suppose at some point the blockchain starts branching. Each new block on each chain gets appended at the same time, until eventually the blue chain gets longer than the green chain due to G being mined faster. Then the green chain becomes invalid.
Does this mean the miners for A, B, C and D, E, F don't get mining rewards at all until a longer branch (in this case, the blue branch) is determined, then miners for D, E, F, G get rewards?
If so, what if a selfish miner releases two new blocks on the green chain after G is being appended? (As shown below) Does that mean the rewards get reversed again?

Thanks!

Edits:
Following up with one of the answers, suppose what we have in the following is a GLOBAL view of all the blocks on the whole blockchain system:

So apparently the colored blocks become orphans. However, block #1 and block #3 seem to still get rewarded, except they can never spend those rewards. So does that mean the total number of bitcoins on the market will practically be smaller than 21 Million (after all the coins are mined), due to these orphan blocks? I.e., some coins are rewarded to the orphan blocks but they can never be used by anyone?
And do block 2, 4, and 5 also get rewarded (but can't spend those rewards)?

user208: You have to distinguish between nodes' local view of the chain, and your global view when discussing here.
Every chain (meaning: a block together with all its direct and indirect ancestors) is a version of history. Within that chain, the block pays out to whomever mined the block. As far as miners on that chain goes, they are extending the chain they believe to be legitimate, and see themselves as being paid in the process. So B's miner believes it is being paid by B, and believes A is being paid by the parent block. Similar with C, seeing A and B being paid.
However, when the reorganization occurs, A, B, and C's miners, along with any nodes which saw those blocks first, realize they were working on a version of history that the network will (probably) not accept, and they switch over to the D-E-F-G chain, in which they are not paid.
Now, there is a rule in Bitcoin called maturity, which prevents the coins minted in blocks from being spent until 100 blocks have been mined on top. This prevents a situation where many transactions are invalidated because of a reorganization that removes the coinbase that formed the initial credit. After 100 blocks, it is highly unlikely a reorganization will still occur.

127819: <p>I am aware this is related to <a href="https://bitcoin.stackexchange.com/questions/12462/what-happens-to-extinct-blockchains-and-transactions-inside-of-them">this question</a>. However, I am specifically curious about what would happen to the <strong>mining rewards</strong>, not the transactions, under a forking condition.</p>
<p><a href="https://i.stack.imgur.com/hHiva.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hHiva.png" alt="enter image description here" /></a>
As shown in the picture. Suppose at some point the blockchain starts branching. Each new block on each chain gets appended at the same time, until eventually the blue chain gets longer than the green chain due to <code>G</code> being mined faster. Then the green chain becomes invalid.</p>
<p>Does this mean the miners for A, B, C and D, E, F don't get mining rewards at all until a longer branch (in this case, the blue branch) is determined, then miners for D, E, F, G get rewards?</p>
<p>If so, what if a <em>selfish miner</em> releases two new blocks on the green chain after G is being appended? (As shown below) Does that mean the rewards get reversed again?</p>
<p><a href="https://i.stack.imgur.com/2NJ1B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2NJ1B.png" alt="enter image description here" /></a></p>
<p>Thanks!</p>
<hr />
<p>Edits:</p>
<p>Following up with one of the answers, suppose what we have in the following is a GLOBAL view of all the blocks on the whole blockchain system:
<a href="https://i.stack.imgur.com/3FqLw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3FqLw.png" alt="enter image description here" /></a></p>
<p>So apparently the colored blocks become orphans. However, block #1 and block #3 seem to still get rewarded, except they can never spend those rewards. So does that mean the total number of bitcoins on the market will practically be smaller than 21 Million (after all the coins are mined), due to these orphan blocks? I.e., some coins are rewarded to the orphan blocks but they can never be used by anyone?</p>
<p>And do block 2, 4, and 5 also get rewarded (but can't spend those rewards)?</p>
 208: <p>You have to distinguish between nodes' local view of the chain, and your global view when discussing here.</p>
<p>Every chain (meaning: a block together with all its direct and indirect ancestors) is a version of history. Within that chain, the block pays out to whomever mined the block. As far as miners on that chain goes, they are extending the chain they believe to be legitimate, and see themselves as being paid in the process. So B's miner believes it is being paid by B, and believes A is being paid by the parent block. Similar with C, seeing A and B being paid.</p>
<p>However, when the reorganization occurs, A, B, and C's miners, along with any nodes which saw those blocks first, realize they were working on a version of history that the network will (probably) not accept, and they switch over to the D-E-F-G chain, in which they are not paid.</p>
<p>Now, there is a rule in Bitcoin called <em>maturity</em>, which prevents the coins minted in blocks from being spent until 100 blocks have been mined on top. This prevents a situation where many transactions are invalidated because of a reorganization that removes the coinbase that formed the initial credit. After 100 blocks, it is highly unlikely a reorganization will still occur.</p>
