What I would do is create a branch from your current state as a function branch so that you don't lose your job.
git checkout -b new-features && git push origin new-features
Now that you have saved your current state in the branch (and pressed it on the remote control), git checkout original branch and put it back to the point in front of the current head.
The best way to do this is to use git revert . A good explanation of why and how to find it on: Cancel multiple git commits .
As soon as you revert the changes, commit and click, I would recommend that you create a branch to develop the patch. This is good practice for the same reason that people create feature branches. A good rule is to create a branch with the same or similar name / number as the problem you are working on. Make all your changes there, and when all this is done, you can pull it into any branch from which you tag your deployments.
The best part of this is that it works whether or not any changes have been transferred to the remote computer, simply and in line with best practices.
Hope this helps.
EDIT: answer the question in the comment.
"It also assumes that the changes you make are only local to your computer and are not pushing to remote branches."
This method will not work if you have already clicked. There are ways around this, but I would not recommend it.
Basically, the only difference between the two methods in their kernel is that it does git reset --hard [commit] , and the other uses git revert . The reset actually tells git to return to a specific commit, which is essentially the effect you want, but frowned if you already clicked. Since git will not allow push changes without a quick transition, and you actually deleted the history, you will need to make git push origin [branch] --force , causing the remote to also lose the changes.
Reverse actually creates a commit that adds a git story about the attacks you kill. This is better, because all discarded changes can be tracked, and anyone who pulled from this branch will not stop synchronizing. They will come back or come back when they are pulled. A good side effect of this is that if you make a mistake in your returned change, you can return it later, as this is just another commit.