TL;DR - Spent some time learning your tools (Git specifically).
There are good tutorials for git available and you can probably pick up enough to be comfortable using branches in less than 1 hour. I am assuming/recommending that when you work through the tutorial you do so in a new repository (so that you don't impact your current production code/repository).
Keeping the code in your repository clean is important - it's another form of technical debt - if the repository is clean it is easier to follow what happened in the past.
However as long as you make time to do the cleanup before you git push it's not all the important when you commit - I make a lot of commits as I am working, with comments indicating what changes I made. Then before I push I clean up my history using git rebase and push a sanitized history to other developers.
Edit per the comment:
If I was in this position, I would just create a new branch and commit the code there, after a week if I found I didn't need it I would delete the branch.
Locally, I don't think it really mattermatters where you put it (commit to new branch, stash, commit+revert or just throw the code away) if you are going to do a cleanup before you push it, it’s simply a matter of whatever workflow works best for you.
However, if I wanted others to view the code then having it on a separate (pushed/remote) branch makes it clear that this is something you considered, but choose not to move forward with.