I am new to git and try to understand how I ll undo /stash changes + logs lets say I have a very fresh branch with no commits yet e.g
git clone https://url testrepo
cd testrepo
git log
fatal: bad default revision 'HEAD'
git checkout
fatal: You are on a branch yet to be born
echo "test" > README.txt
git status
On branch master
Initial commit
Untracked files: (use "git add <file>..." to include in what will be
committed)
README.txt
nothing added to commit but untracked files present (use "git add" to track)
git add .
git status
On branch master
Initial commit
Changes to be committed: (use "git rm --cached <file>..." to unstage)
new file: README.txt
git commit -m "My read me file "
[master (root-commit) 6357fd2] My read me file
1 file changed, 1 insertion(+)
create mode 100644 README.txt
git status
On branch master Your branch is based on 'origin/master', but the
upstream is gone. (use "git branch --unset-upstream" to fixup)
nothing to commit, working directory clean
(I don't understand what does "upstream is gone" mean :( )
However, now lets say I want to stash all changes. One simple solution is to delete the clone and re-clone from remote repo . What are other options to undo the above commit so I ll again have a clean checkout (without commits + commit history (logs)