So I was just testing some things on my master
branch but knew I wanted to reset/revert to the last commit on master
to before I started these test feautures. So I immediately create a new branch (lets call it testfeatures
) that I thought would not be affected by using git reset --hard
while on the master
branch. The new testfeatures
branch was created in the same state as the master (so it still had all those test features), and I then checked out back to master. While on master, I used git reset --hard <#lastcommitidhere>
. Now, this reset my master branch to how I wanted it, but come to find out it also reset the previously create 'testfeatures' branch (after creating this branch, I didnt commit anything before switching back to master and resetting).
So my question is, how would I undo the reset back on any branch to get those test features back? Is it possible? Also, why did resetting master have an affect on my other branch, as I thought they were isolated?
Also, the "test features" were not commited on the master branch either before the reset.