Jump to content

Revert / Rollback a single file


KrisK

Recommended Posts

Is there a way to revert a file to a certain previous state without loosing part of the files history?

Let's start with a qualitative description of what we want to do :): We've made some number of commits, five of which changed a given file, and we want to revert the file to one of the previous versions without.

Unfortunately revert to this revision from the history seems to remove the history beyond the revert revision. Also subtractive merging seems only work on a changeset level and not a file level.

Link to comment
Share on other sites

Hello @KrisK,

the "revert" operation will not remove the history beyond the selected revision, history remains as it is, you are just changing the "head" revision of the file but if you check the file history after the revert you will see that the rest of revisions are still there.

From your statement:

15 hours ago, KrisK said:

We've made some number of commits, five of which changed a given file, and we want to revert the file to one of the previous versions without.

I think the revert operation is what you need, let me know if I'm missing something.

Best,
Manu.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...