Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

revert vs. update for uncommited changes

Tags:

mercurial

Suppose you have commit some changes, and then somehow deleted/modified some files by accident.

Which would be better? Using revert oder update?

like image 695
helpermethod Avatar asked Jan 13 '11 15:01

helpermethod


1 Answers

There are two big differences between running hg update -C and doing hg revert -a

  1. Update will move your parent up to the tip of the head of the branch
  2. Update will no create any backup files

The revert command on the other hand

  1. Creates backups of all reverted files (unless you give --no-backup command)
  2. Does not change your working directories parent changeset.

Now which is better? Depends in which of the things listed above you want.

like image 56
Matthew Manela Avatar answered Oct 08 '22 17:10

Matthew Manela