M
M
My joy2017-08-22 22:11:30
git
My joy, 2017-08-22 22:11:30

Git marked all files in the branch as changed - how to rollback?

Hi all.
I work in git with one file, but at some incomprehensible moment, all the files in the branch were marked as modified. though I haven't changed them. Is this a glitch? How to deal with it, how to turn everything back?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniel, 2017-08-22
@t-alexashka

It is possible that there was some kind of glitch with Git in the folder of the problematic project, or the IDE, if it was worked with before the problem, changed / saved something in the files.
In any case, if you did not change the files, i.e. before the problem were with a committed commit, then you can simply revert all changed files to the state of the last commit: git checkout .
UPD: I didn't notice the stipulation that you were working with one file. In this case, with a command like git checkout file.cpp (where file.cpp are the files you haven't changed) you can return the state of the last commit to all changed files, without touching the one you were working on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question