1

Are the following combinations of commands equivalent?

Combo #1:

git revert HEAD
git revert HEAD

Combo #2:

git revert HEAD
git checkout HEAD^
git commit

Related thread: Git cancel a revert

Community
  • 1
  • 1
lewen7er9
  • 63
  • 6

1 Answers1

1

Yes, except you will be prompted for the commit message in the commit in combo 2. Unless you memorized the format of revert messages and look at the commit you are reverting, you will have a different sha-1.

You can force custom messages in a revert with a --no-commit option and then you can paste in the same message in both case.

Hope this helps.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • That helps. Just wanted a few more sets of eyes to look at it, and glad I did b/c I missed the different sha-1. Thanks! – lewen7er9 Mar 21 '11 at 01:33