The notions of trade creation and trade diversion emerged because of the need to describe the effects of preferential trade agreements. In his highly influential book (1950), Jacob Viner articulates that the trade-creating effect is the “shift in the locus of production” from the high-cost home country to a lower-cost partner country, and the trade-diverting effect is the “shift in the locus of production” between a low-cost third country and a high-cost partner country.
Let us consider a simplified example. Suppose you are in country A (home country) and there is a product that you produce and export. If the sales of the like product in country B (partner country) by your competitor established in that country drop becase your exports increase – what occurs is trade creation. You most likely benefit while your competitor loses, all other things being equal. The reverse effect – where your competitor's product replaces your product in country B's market – is not addressed by Viner as it is not expected to happen in a trade agreement. It can be easily recognised as import substitution, but I call it "trade contraction" for consistency with other terms. In this case, your competitor in country B is set to benefit, and you lose.
The above concerns home country and partner country. What about third countries? You may expand your exports to country B at the expense of reduced sales of the like product from country C (third country). This is trade diversion as defined by Viner. You benefit and your competitor in country C loses. We must not rule out the case where, vice versa, your sales in country B shrink because the demand in country B switches to the like product from country C. This is also trade diversion, harming you and benefiting your competitor in country C. To distinguish between these two cases, I call the former "trade diversion towards partner" or just "trade diversion in" and the latter "trade diversion away from partner" or "trade diversion out".
Note that in the simplified example above, I describe the effects that occur in partner country (B) market and affect you in home country (A). However, the same four effects may originate in your home market: your competitors' products may replace your product in country A's market or vice versa. In sum, you are affected by trade creation/diversion/contraction at home (country A) and at the competitor's market (country B). We may add up an effect, say, trade creation, that affects you at home and at the partner country market, to obtain net trade creation. Then net trade diversion in is typically positive, net trade diversion out is negative while net trade creation and contraction may be positive or negative depending on the balance between home and partner countries.