+1 vote
1 view
in Devops and Agile by (20k points)

How can I undo every change made to my directory after the last commit, including deleting added files, resetting modified files, and adding back deleted files?

1 Answer

0 votes
by (28.4k points)

Step 1: Reset the changes with the help of following command:

$ git reset HEAD --hard

Step 2: Clean out everything untracked. In case you want to keep files that are not tracked due to .gitignore, be careful with this command.

$ git clean -fd

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...