Git

Last Updated: 7/27/2023

Discarding Local Changes

  • Git is going to take the version of the file in the next environment, which is our staging environment, it's going to take last version and copy into our working directory
git restore file1.js
git restore .
  • For untracked files use git clean. If you accidentally remove the untracked files, there is no way you can recover them.
  • Use -f for force remove, -d to remove directory
git clean -fd