DEV Community

Discussion on: 15 Git Commands You May Not Know

Collapse
 
zerquix18 profile image
I'm Luis! \^-^/

Here's my small contribution: If you added a commit and already pushed it or merged it into another branch and you need to reverse those changes, you can always go:


git reverse {hash}

It will create a new commit with the changes reversed. Also, the new commit will have a reference to the reversed commit (i.e Github will tell you "this reverses {hash}")

Collapse
 
rajeshduggal profile image
Rajesh Duggal

Which version of git has "git reverse"? I can't find it mentioned in git-scm.com/docs

Collapse
 
mfilej profile image
Miha Filej

Probably meant git revert