That's a good question, but nothing really substantial changes.
The node will reconnect to a peer (whose IP address has remained the same) and the node's new IP address is added to the list of available peers. The old IP address remains in the list, but eventually removed when it gets older: the peer list also keeps track of the last time it saw the node.
it shares its own ip to all of the peers
It doesn't actually, the node you connected to will tell you what your IP address is. (I'm not a 100% sure about this tho)
what if the list if full of old IPs?
Well, that's why there are 'seed nodes' active on the network. They often use domain names, which get resolved to IP addresses (so they can change). They only exist to distribute peer lists. In Bitcoin Core, you connect to the seed node and disconnect after about a minute. You should have enough IPs in your peer list to remain connected to the network from then on.