2 ms·
git checkout somefile will discard edits which you've not added to the index. This command is destructive of course. git rm -f somefile will delete a fi
by rwmj 11y ago
git checkout somefile
will discard edits which you've not added to the index. This command is destructive of course.
git rm -f somefile
will delete a file from the repo (you then have to commit the change). If you want to permanently delete a file, including from history, eg because it contains a password, that's a bit more difficult, but possible in some circumstances.