How to make a sword appear from behind a tree in 2D Animation
If you press TAB to go to object mode, then duplicate the tree with SHIFT+D, then extrude (E), and fill (F):



between the vertices at the edges, to make an object that will cover the sword (or anything else), then make the material of this object just filled white (or whatever colour* your background is):

*I'm British so I spell it properly



then that should cover the sword perfectly behind the tree. If the sword is still in front the tree, then check that it is behind the tree in 3D space.