0

Currently, I have 1,2,3(master) version, however, in version 2, some file has been deleted. Now I would like to revert back to version 1, and set it as my master which is version 4.

I try checkout to version 1, and create a branch. and then I switch back to master, and merge the version 1 branch. It seem like version 3 still the master.

How can I set version 4 as version 1? Totally out of idea to do it.

Looking solution for TortiseGIT if possible.

Thanks!

Shiro
  • 7,344
  • 8
  • 46
  • 80

2 Answers2

1
  1. Open Log Message dialog, right click on first commit, perform Compare with working tree

enter image description here

  1. TortoiseGit shows you the Changed Files dialog, select all files in the list, right click them, perform Revert to revision.

enter image description here

  1. Commit the reverted files, and the log

enter image description here

Yue Lin Ho
  • 2,945
  • 26
  • 36
0

If you by version mean commit then returning one commit back can be done like this: git reset --hard master~1 although it seems to be an ugly hack.
I found this solution in question, you should check it out as I think you will find solution there.

Community
  • 1
  • 1
lsrom
  • 608
  • 8
  • 22