I deleted both the local and remote branches for a particular branch
git branch -d branchName
git branch --delete --remotes origin/branchName
When I checkout out a different branch, I am still seeing the untracked/uncommitted files when I run git status.
Those files don't have any changes that I want to keep or stage or commit. I don't want to see them sitting in the area when I run git status on the different branch
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: ../../../../path/to/folder/file.html
modified: ../../../../path/to/folder/file.js
I want to see this when I run git status on any branch I checkout
On branch proj/branch/#
Your branch is up to date with 'origin/proj/branch/#'.
nothing to commit, working tree clean
Is there a way to do this, if so, how is that done?
Typically, to undo the changes on all files and restore them to their last commited state, you'd do :
(here
HEADis implied)(doc)Warning however : this is not undoable.
You could also just
git stash, this would also get rid of the changes, but in case you want to get them back later or just inspect them, you'll be able to, either with a simplegit stash show <stashRef>, or withgit apply <stashRef>, where the<stashRef>is to be found withgit stash list.To answer your comment about stash, in case you stashed something and don't need it any more, you have two ways of cleaning old stash entries :
(where
<entryRef>is found throughgit stash list)