How are links created in IPFS? What happens to the link when the content is changed?

I wanted to learn about link creation in IPFS.
Suppose, I have a file. Corresponding to the file, a hash is generated which shall form a link.
But later I edited the file. Then a new hash shall be generated for the file. This means a new link shall be generated.
This means every time the file is edited a new link shall result.

But this process shall result in inconsistency. If i had a link to refer to a particular file then due to the change in link, I may not be able to refer to the same file again.

Please correct me if I am wrong.

Correct. IPFS hashes are immutable by definition.

But lookup IPNS (IP name system). You can link every version of your file with the private key of your file, and the IPNS link always point to the last version.

1 Like

Thank you @Akita for answering.