Discarding All Local Changes
1. Modifying local Files
2. Discarding all Local Changes:
git reset --hard origin/main
How to Discard Changes in Git?
In Git, “discard changes” refers to reverting modifications made to files in your working directory back to their state in the last commit, effectively disregarding any changes you’ve made since then. This action can be useful if you’ve made changes that you no longer want to keep or if you want to start over from the last committed state.
Table of Content
- Steps to Setup Github
- Discarding Local Changes in a File
- Discarding All Local Changes
- Saving Changes on the Stash