Don't lose unsaved data when switching branches

Fixes #8