Ability to reset a file to a particular commit
If I right click on a file from commit X, one of the options should be to reset that file to its state as of commit X. This would not involve any merge. It would just change the contents of that file to match whatever it was at the time of commit X.
Comments: 11
-
26 Jul, '21
Giacomo Zanotti AdminRight now, users can create a branch or checkout the commit to update the working directory to match the commit's snapshot. How does only updating a file help with your use case?
-
29 Jul, '21
William JockuschThere can be a lot of different reasons. I may want to look at the way something used to work. I may be abandoning a branch but want to keep the changes to one file. I may be resurrecting a deleted file. I may be hunting for the source of a regression. I may simply want to confirm that the file is the same in commits X and Y.
For me, the main thing is that it is a simple, easy-to-understand operation. The more such operations one has in one's toolkit, the more efficient the toolkit is. -
17 Dec, '21
Peter HeadlandI often want to cherry-pick a subset of files from another commit. Assuming it supports multi-select, the requested feature could give me that capability.
Having looked through all the requests just now, I see about five that are similar to this. It looks like there are two use-cases - cherry-pick only the changes from a single commit, or reset a file to its state as at a specific commit. These operations are so closely related that it seems to me that the UI should present them as options on a single operation IFF the result would be different (a lot of the time, the two will produce the same result). -
03 Jun, '22
William JockuschI keep running into this. One recent case was that I felt the new way something was done was inferior to the old way. I just wanted to back the file up. Cherry pick does not do allow one to do that. It says the change in question has already been merged.
Another case grew out of a merge conflict. After doing the merge, I wanted to reset the file to one of the pre-merge versions, simply to peruse the changes. In a large merge with tens of files, this can be considerably easier than finding the file in the merge diffs. Furthermore, if one wants to examine the changes from the half of the merge that Kraken's diff is not showing, it's not available at all. -
02 Feb, '23
ChrisMIn my company, we often need the functionality in our java projects where we have multiple developer with multiple branches and where we need to reset one or more (but not all) files to a special commit to be able to continue working.
i would be very happy to see this feature here. -
09 Mar, '23
Marie RI agree, this would be a useful feature. An example scenario is when a developer breaks a feature in one file but the rest of their work is fine and the commits cover multiple files. Regressing a specific file to the state of a specific commit is useful and relatively easy to do from the command line (https://dev.to/lofiandcode/git-and-github-how-to-revert-a-single-file-dha), but we are using gitkraken hoping to avoid having to use the command line...
-
31 Mar, '23
Christian RohmAny updates on this request yet?
I got to admit this would be a very usefull and mighty feature that would benefit a lot of workflows :) -
11 Sep, '23
VladRight click on a file and choose "Reset to commit..." is a MUST! Also, what's the value of File history (right click on a file and "File history") if I cannot perform any actions there on that file but just view the history. I want to be able to reset the file to a certain point in the history. This is a basic functionality that must be present in any git client (and it does).
-
21 Sep, '23
Maëva TrivinoIf I can add, as an example, I was using SmartGit at my previous job and it's was possible to take version after the commit or before and apply it as a new change.
Was actually the best feature ever for tests purposes or maybe revert just a few files from a commit. -
09 Oct, '23
Caspar Schutte MergedA feature I miss from using Git Extensions, that the ability reset or save only a selected file or files from any commit in the history. Currently I have to checkout the entire commit, copy the interested files somewhere else, reset back to the branch where I would like to apply it and move the files back. Git Extensions, allow me to do this with a single click.
I know Cherry pick exists, but cherry pick, picks the entire commit. Sometimes I do not want to only selectively reset certain files. -
09 Oct, '23
Joey Kelroy Admin"Being able to reset a single file from a previous commit" (suggested by Caspar Schutte on 2023-10-09), including upvotes (1) and comments (0), was merged into this suggestion.