How to discard all Mercurial changes that have not been committed

How do you discard all changes to the repository since the last commit in Mercurial?

I don't think this is a command revertbecause it will actually update the working directory to the last commit. I just want to undo changes in the repository (added files, deleted files, etc.).

But I'm new to Mercurial, so something is missing me.

+3
source share
3 answers

revert. revert update . , update (. hg parents), revert - . tip, , , revert.

:

ry4an@hail [~/hg/test] % hg stat
? newfile
? output.patch
? this
ry4an@hail [~/hg/test] % hg add newfile
ry4an@hail [~/hg/test] % hg stat
A newfile
? output.patch
? this
ry4an@hail [~/hg/test] % hg revert --all
forgetting newfile
ry4an@hail [~/hg/test] % hg stat
? newfile
? output.patch
? this
+8

: Mercurial -

, "-" .

+2

, , :

hg update -C

, .

+2

Source: https://habr.com/ru/post/1744145/


All Articles