I assume your shares are in a taxable account. The average cost basis of all your shares never changes. The average cost basis of any remaining shares does change, if you don't sell them all.
In practice, as long as you get rid of the shares within a quarter (for timely tax purposes), it doesn't matter. Or, get rid of them in the same tax year.
Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.