Hanwen Zhang17,774 Points
git checkout -- <filename>
Does git checkout -- <filename> checkout at the commit stage and save the change automatically through committing it?
git checkout -- <filename> = git checkout HEAD <filename>
I Googled your question and got this:
The git checkout command lets you navigate between the branches created by git branch . Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch.
I hope that helps.
Stay safe and happy coding!