11/19/2023 0 Comments Sourcetree checkout at specific commitPlease note that this 'Reverse' feature actually applies an 'inverse patch' to your working copy, so although in theory you can reverse any previous change at any level of detail, the more the file has changed content since the commit you're trying to reverse, the more chance the patch won't apply any more and you'll have to back the changes out manually instead, or use the more severe Option 1). The 'Reverse' buttons are available in the Log Selected single-file window too. These changes will appear in your working copy ready to be tested/committed Use the 'Reverse File' button at the top to reverse all the file changes, or use 'Reverse Hunk' or 'Reverse Selected Lines' to undo just portions of that change. Select the file in that commit whose changes you want to reverse This is more selective than resetting the entire file back to a previous point. You can Reverse file changes made to a file in a commit, undoing them in your working copy. Note, you can also do this in the main log view (right-click the file in a commit and pick "Reset To Commit", but it's easier to find the commit you want when you use the file-specific log. Right-click this commit and select "Reset To Commit" So this would be the commit before the changes you wanted to reverse Pick the commit in the list which represents the state at which you want the file to be returned to. This gives you a history just of that file. Then push the new branch to the remote with git push. git checkout -b fix/revert-change 7978732. Right-click the file (in any view) and pick 'Log Selected'. Better to create a new branch with a specific commit and send a PR to the branch that you need since It has old changes in the old branch as well new revert changes in your new branch. If you want to return the file to a previous state, there are a number of ways to do this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |