You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkout master (now one commit behind other-branch)
proj [other-branch] $ git checkout master
Switched to branch 'master'
change the file to something different from other-branchwithout committing
proj [master] $ echo different-change > foo
attempt to check out other-branch
proj [master X] $ git checkout other-branch
error: Your local changes to the following files would be overwritten by checkout:
foo
Please, commit your changes or stash them before you can switch branches.
Aborting
clear changes, then create a file, and checkout other-branch
proj [master X] $ git checkout -- foo
proj [master] $ touch bar
proj [master X] $ git status -s
?? bar
proj [master X] $ git checkout other-branch
Switched to branch 'other-branch'
proj [other-branch X] $ git status -s
?? bar