Manish Champsee
Manish Champsee

Reputation: 465

How do I undo a prior commit though leave everything afterwards intact using Git?

I deleted some files some time ago that I need back. I'm using Git.

How do I undo a commit that was done some time ago and leave everything else since then as is?

Upvotes: 0

Views: 20

Answers (1)

John Zwinck
John Zwinck

Reputation: 249183

You can do this:

git revert <revision>

Just find the sha1 revision ID in your git log that you want to undo, and this will make a commit which is the opposite, thereby undoing the old commit.

Upvotes: 2

Related Questions