J
J
john782022-01-31 14:33:34
git
john78, 2022-01-31 14:33:34

How to return the project to the state it was in before the files changed (to the last commit)?

A task was done in the develop branch, then git add, git commit, and git push to the github repository.
Now I mistakenly added several dozen files, and some files have changed.
After that, I did not add, git commit, and git push. Therefore, I think it is possible if you return to the state of the last commit, the changed files will return to their previous state, and the new ones will disappear and there will be no files with modified status in git status. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Tkachev, 2022-01-31
@john78

git reset --hard HEAD

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question