I'm adding a feature on master branch. After changing several files, I realize that I need to check the output without my changes.
The way I can think of is:
- Commit current changes
- Check out and switch to a new branch
- In the new branch:
git reset --hard HEAD^
so that I get back to the original code. - Try the code and when I'm done, switch back to master branch and delete this new branch.
Is there a better way for this?
Can I save a snapshot of current changes and come back later when I am ready?