GIT help!! I was switching between branches.. something happened and a lot of files in master branch got deleted/modified. i haven't add/committed/pushed anything to the remote git repo. this is still in the local. how do i undo all the deletions?
Assuming the, "deletion" was of stuff existed on the remote, and not non-commited work, just git rebase <upstream>/<branch>. Example: git rebase upstream/master
What is the output of `git status`.
several deleted/modified files. git was asking if i wanted to add, commit and stuff. i managed to fix it by doing "git checkout ."
but it was still odd. i was in the master branch. i wanted to jump into another branch, where i haven't gone in awhile, so it has very few files compared to master. all of a sudden, i couldn't move to the other branch. i was in the master branch but git status tells me every file i didn't possess in that other branch was deleted on the master branch and other modified files. weird
`git checkout .` would reset the current branch you are on to a pure state. (i.e. the ^HEAD) What it sounds like you did was essentially enter a detached state. Cheers on fixing your git issue, most of the time they are not that essay to fix.
Join our real-time social learning platform and learn together with your friends!