Q:

How to update contract that has already been published to nodeos? 

I published a contract to my localnet using:
cleos set contract myaccount mycontractfolder -p myaccount

Then I made some updates to the code, and want to publish them, I type the same command again, but this time, I get the error message:
Error 3160008: Contract is already running this version of code
Error Details:
contract is already running this version of code
pending console output:

How can I publish the contract updates without restarting nodeos? 

A:

Certain small code changes get optimised out by the WASM compiler, resulting in an identical .wasm file, so nodeos may reject the update.  
Try making a more significant code update such as introducing a new function or calling eosio::print(), and you can see if it works.