There is not any capital gain for either the donor or the recipient of a gift upon transfer. Only the later sale or transfer of the gifted property is subject to income tax.
So, if you are gifting the stock back then there is no income tax to either party and there was no income tax on the original gift to you.
It actually sound like it is intended to rescind the original gift and that then would be deemed to not ever had been a gift completed. Again, in that circumstance there is no income tax for rescinding the gift.
When a beneficiary gets assets from an estate there is not income tax upon receipt, much like a gift. When the asset is later sold be the beneficiary there will be gain or loss on the sale.
It is often better to inherit stock, or other assets, than to get them as a gift since generally the cost basis to figure gain of a gift is the original cost basis of the donor but the cost basis of inherited propeprty is the value at the date of death. That is, the beneficiary of an estate does not have to pay gain that occurred during the lifetime of the decedent.
Please ask if you need more information or discussion.