So for years I have been using a subset of git commands that served me well. But I need to know the difference and preferred use of two very similar behaving commands. So.
When I have edits in one or more files that are checked into the repository and I want to remove all those edits (edits have not been staged), I use the command:
git checkout -- <path>
But apparently there's a more modern alternative.
git restore --source=HEAD --staged --worktree <path>
Is git checkout -- <path> going to be deprecated at some point? What is the difference between the two?