There's a setting under Accounting Preferences for 'Do Not Update COGS and Asset Accounts on Existing Transactions When Accounts Are Changed' - if this is not checked, it will update all historical transactions involving the item (or throw an error). If it is checked, you are able to update the COGS account with no historical effect