internal: reset both ref and working directory after update