How do I roll back all or part of a commit to svn?

前端 未结 4 2226
天涯浪人
天涯浪人 2021-02-19 19:16

How do I revert all or part of an SVN commit using TortoiseSVN?

4条回答
  •  太阳男子
    2021-02-19 19:30

    First, you need to identify rather you want to revert back "all changes" of a revision, or just a single file. TortoiseSVN has only the "1 or all" approach; meaning, you can revert back the entire check-in set, or single files: not partial checkins.

    Entire Changeset

    So, if reverting back a specific revision (and you want all files in that changeset to be changed), you will want to Right-Click -> TortoiseSVN -> Show log. Find the revision/changeset you want to rollback to, right-click on that revision "Revert to this Revision".

    There's another option which might interest you, which is "Revert changes from this revision", which will do a Diff-merge between that revision and your current version, and merge just the differences. I find this more appealing at times; so, I can keep all changes inbetween the changesets.

    Single file

    The other option is to revert a single file back. You would again do Right-Click -> TortoiseSVN -> Show log; but this time, you can select a single file.

    TortoiseSVN does not let you select multiple files in a changeset to revert back to. It's either all, or just 1.

    Changeset checkins

    For all others reading, make sure "checkins" only involve the files related to that change. This should be common practice these days; but, I still find developers "shotgunning" the checkins at the end of the day, bundling up all changes for the day into a single checkin.

    I gleam at those devs with w squint. -_^

提交回复
热议问题