Only after 20 turns have passed. At that time you can go into the trade screen with the civ you're trading it to, choose 'active deals', and cancel the trade. I'm not positive, but I think that doing it sooner results in a war. You can get around this by pillaging all of your own supplies of whichever resource it is -- that'll break the trade route, and that doesn't cause war. It will, however, destroy your trading reputation: you will no longer be able to buy hard goods (technology, maps, contacts) using any amount of per-turn goods (luxes, gold per-turn, resources), even in combination with cash.
Renata