Decoding hash with solidity

we know how to generate a hash with keccak256 and abi.encodePacked, but is it possible to do the reverse?

That is to say how to decode a hash in solidity?