Reputation: 5734
I made a mistake and removed a file. I'd like to go back to my previous commit! I tried with revert and backout with had no luck...
Any tip?
Edit: I did exactly this:
hg forget file hg commit -m "Blah" hg push
The revision number of this last push is 17.
Now file is not tracked anymore. I'd like to get it back to revision 15 (not the inmediate previous rev, but one extra step back) as i do not want to keep working on the file in rev 16.
Upvotes: 8
Views: 5238
Reputation: 1808
Try pulling version 15 and hg pull -r
and then adding the file.
Upvotes: 0
Reputation: 66739
If you have committed then you could update to previous version. If the file is version controlled, it is not going to go away. Thats what version control are for.
hg update -r "what is previous rev"
If you have removed a file and had not committed, then simply do the update and it will restore the file.
hg update
[edit: based on edited question]
hg revert file -r 15
hg update file -r 15
Upvotes: 0
Reputation: 5734
Found a solution:
hg revert file -r15 //(reverts file to revision 15).
Upvotes: 9