Inverting the signature of a path