Hypergraph reconstruction from dynamics