fix revert to cope with moved nodes properly (OH NOES I updated some SQL)