The TreeWalker.previousNode() method moves the current returns the found node.
TreeWalker.previousNode()
MDN Reference