0 votes
1 view
ago in Devops and Agile by (3.1k points)

How to delete all changes from the working directory including new untracked files. I know that git checkout -f does that, but it doesn't delete new untracked files created since the last commit.

Does anybody have an idea how to do that?

1 Answer

0 votes
ago by (4.7k points)

Simple way to do this:

Step 1: Revert modified files using the following command: 

$ git checkout -f

Step 2: Remove untracked files: 

$ git clean -fd