Hash functions are often called one way functions however this means that you should not be able to undo them. So why and how are SHA256 and SHA512 used in blockchains if they should be irreversible.

Also I noticed that Plutus has some unhasing functions how do these work?