How to revert a single file to its state in main in branch

I want to reset a file stored in a git repo to its state as the main branch, and I kept forgetting how to do this. So here is how, just to remind my future self. ➜ git status On branch main Your branch is up to date with 'origin/main'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: kube-prometheus-stack-values....

February 28, 2025 · 1 min · 157 words · kenno