Undo Check Out reverses the checkout, and allows you to return to the model that you originally checked in. Undo Checkout acts on the object open in the active model and reverses any changes that were made to this object after it was checked out.
Try this first:
git checkout master
(If you're on a different branch than master
, use the branch name there instead.)
If that doesn't work, try...
For a single file:
git checkout HEAD /path/to/file
For the entire repository working copy:
git reset --hard HEAD
And if that doesn't work, then you can look in the reflog to find your old head SHA and reset to that:
git reflog
git reset --hard <sha from reflog>
HEAD
is a name that always points to the latest commit in your current branch.
To undo git checkout
do git checkout -
, similarly to cd
and cd -
in shell.
You probably want git checkout master
, or git checkout [branchname]
.
If you are using github, chances are the name for default branch is no longer master
. Try git checkout main
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With