saving changes before branch switch