Work-related relocation deductions (Tax) when moved out of the Germany

[Dumb Question]: Can we deduct Work-related relocation costs when we move out of Germany or is it only considered when we move to Germany?