As in the title: "How to go back to last commit + delete all newly created file?" Thanks.
Asked
Active
Viewed 2,566 times
4 Answers
7
If I understand the question correctly, you've done a bunch of work, haven't committed it, and want to git rid of that work and go back to your last commit. Is that correct? If so, I think you need a combination of two commands:
git reset --hard # reverts tracked files to commit you were working from
git clean -f # removes untracked files that haven't been added to git yet
Hope that helps.

Mike Monkiewicz
- 4,481
- 1
- 22
- 19