Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3273358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:55:25+00:00 2026-05-17T18:55:25+00:00

Sometimes, for whatever reason, I have to produce patch-files (under Linux) that are in

  • 0

Sometimes, for whatever reason, I have to produce patch-files (under Linux) that are in the wrong direction. I know that I can deal with this by using the -R switch when applying it via patch, but it would be nice if there were a way of permanently reversing the patch-file. Is there a utility that can do this, or e.g. a regex that would be guaranteed to work?

UPDATE

Lie Ryan has suggested a neat way of doing this. However, it requires access to the original source file(s). So I suppose I should update my question to state that I’m more after a way of achieving this given only the patch-file itself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:55:25+00:00Added an answer on May 17, 2026 at 6:55 pm

    You can use the tool interdiff(1) from patchutils. In particular, the man page for interdiff says:

    To reverse a patch, use /dev/null for
    diff2.

    So,

    $ interdiff -q file.patch /dev/null > reversed.patch
    

    The -q / --quiet prevents the insertion of reverted: lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using C and sometimes I have to handle paths like C:\Whatever C:\Whatever\ C:\Whatever\Somefile
Sometimes I have to work on code that moves the computer clock forward. In
I have a third-party library that is sometimes throwing an exception. So I decided
Sometimes when I'm editing page or control the .designer files stop being updated with
Sometimes I need to quickly extract some arbitrary data from XML files to put
Sometimes a labeled break or continue can make code a lot more readable. OUTERLOOP:
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file
I am just wondering how some things work in gamedev: I know, that the
I'm not trying to start an argument here, but for whatever reason, it's typically
I have a console application that sends customized emails (with attachments) to different recipients

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.