Today I was working on my project, and I tried a new algorithm that didn't work well. Thus, I don't want to include it in the project, but I'd like to have a commit with the code in the repository just in case I want to refer back to it later. Here is what I did:
git add .
git commit -m "Lorem ipsum..."
Wrote down the commit hash in my notebook with some notes.
git reset HEAD^
So now, that commit is not part of the branch history, but if, in the future, I need this commit, I can simply check it out by using the commit hash. But here is my question:
Will this commit ever be pushed to the remote? Or will it stay only on my local machine forever? Obviously, this would be bad, because if I ever have to move machines, etc., I will lose this commit when I re-clone.