Decoding cyclic code, assuming we have no errors
Let us start with generator matrix $G$, a matrix of $k$ rows and $n$ columns where $n\ge k$. Given any input row vector $s$ of $k$ characters, we can generate the codeword for $s$, a row vector of $n$ entries by 
$$w=sG$$
If given $s$, how can we get back $w$? Suppose we can find a matrix $G'$ of $n$ rows and $k$ columns such that 
$$GG'=I_k$$
where $I_k$ is the identity matrix of $k$, we will have 
$$s=sI_k=s(GG')=(sG)G'=wG'$$

So the question becomes how to find such matrix $G'$ from $G$. You should be able to find in your course material the procedure or technique to accomplish that. Note that $G'$ is not a square matrix. In general $G'$ is not unique, either.

Now suppose you are given a generator polynomial instead. You can form the generator matrix from the generator polynomial and proceed as above. There might be a shortcut procedure for generator polynomial because of its special form.