T
T
theand12019-10-10 16:01:29
git
theand1, 2019-10-10 16:01:29

How to reset files that have been changed in git?

Here are the changes, how to reset them (return to the previous state (at the time of the commit))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
natashta, 2019-10-10
@natashta

Revert to a previous commit?
$ git log, find and copy the desired commit number.
$ git checkout, insert the desired commit number

R
Robert-critical-thoughts, 2019-10-10
@criticalsomethoughts

Reverting git changes

D
Dmitry Belyaev, 2019-10-10
@bingo347

I will add to the answers given earlier:
if you need to roll back changes to specific files not made to the commit:
git checkout -- path/to/file
where path/to/file is the path to the file or folder, you can use the usual path masks, if you specify a folder, then will roll back all attached files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question