Elohim said, Behold, I have given you every plant yielding seed that is on the face of all the earth, and every tree with seed in its fruit. You shall have them for food.
Genesis 1:29
And YHWH Elohim commanded the man, saying, You may surely eat of every tree of the garden, but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die.
Genesis 2:16-17
This sounds like a contradiction, but that misunderstands the nature of the text. The Bible frequently uses terms like "every" and "all" when it is referring to a category and not necessarily every single member of the category. In English we would usually say "all kinds of" instead of "all".