Jo So
Jo So

Reputation: 26531

Can a patch be safely unapplied?

Can I assume that after a successful

patch < mypatch

the reverse

patch -R < mypatch

will always succeed, and make the previous changes exactly undone?

I know that there are several patch formats and certainly many patch/diff programs, so please if that's relevant specify to what versions/systems you relate.

Upvotes: 4

Views: 70

Answers (1)

Bugasu
Bugasu

Reputation: 537

Patch files are supposed to work in reverse perfectly. Generally speaking, patches merely list lines added and line removed. Using -R simply interchanges these too, making lines added look like lines removed, and lines removed look like lines added.

So long as you have not modified any thing after performing the patch, the removal should always work.

Upvotes: 1

Related Questions