A decoder is a device which is the reverse, undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode.
An endec is a device which both encodes and decodes, either with the same or separate circuitry or algorithm.
The general difference between an endec and a codec is that hardware is usually considered to be an endec, while software is considered to be the codec. Similarly, the word "encoding" is usually used for hardware, while "coding" is usually used in regards to software.
Examples of encoders, decoders, and endecs: