For reference: My master branch is essentially a dead branch (I haven't visited in months), all deployments are made from my dev2 branch. Checking out to master was an error of natural reflex since my other projects all use master.
For context: I was on a feature branch, I checked out to master and all of my untracked files were automatically updated. I need these files to return to their previous state for my code to be in working order.
Here is a list of my operation in order with their related git notifications:
From a clean working tree, git checkout master
$ git checkout master
Updating files: 100% (59224/59224), done. Switched to branch 'master'
I ran a git status
$ git status
Untracked files: (use "git add ..." to include in what will be committed)
.DS_Store
.env node_modules/.bin/
etc.
but note that the list is long and they are node modules and cp resource files.
I ran a git add
, and then git stash
$ git add .
$ git stash
Saved working directory and index state WIP on master: c28616b90 fix ht access
Then I did a git status
$ git status
On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean
Checked out to a working branch called "dev2", which is essentially my master branch
$ git checkout dev2
Updating files: 100% (59224/59224), done. Switched to branch 'dev2'
It appears the untracked files updated on master have followed me to other branches and updated those branches.
Here's a git log
$ git log
commit f45afe47f6c5d4e1e63c71748cd556d9c133fd21 (HEAD -> tyClients)
commit c82fb69f9147082ccdfe6d955be7e4a5508b7f3a (origin/dev2, mobForms, dev2)
The file updates are in my gitignore.
I would like the untracked files to return to their previous state on all branches before this git stash
or at their state of my last real commit.