This lets you easly review them, since they appear in the bottom right part of GitKraken and you can discard or commit as needed. This will reset your working directory to the selected commit, but keep all changes (compared to your previous state) as staged changes. We want to revert to the previous commit and delete all commits from the history. Instead of a hard reset, you can perform a soft one. Example-2: Use git reset to revert to previous commit. You can, however, compare your current state to a previous one, in the way Díaz Riveros suggested. Git does only know one working directory, so this is not directly possible. "give me the contents of this historic commit into a different working If your prevous state is still reachable from any branch (this is the case if you created a backup branch), you can still look at all the commits and their changes.īe aware that you loose unstaged and uncommited changes when doing a hard reset. You'll be back at the selected commit as if nothing happened. commit), you can use the reset to this commit - hard. If you just want to return to a previous state (i.e. "Take the working directory state to this historic commit" The question now is what you actually want to do: Need to do this so that all files that have been created in subsequent commits are deleted. Thus, you can relax and just try things out without the need to worry about breaking anything. How to roll back to a certain commit Ask Question Asked 3 years, 11 months ago Modified 3 years, 11 months ago Viewed 617 times 1 I have a list of commits. If things go awry, check it out and you're back. If you want to be sure you can go back easily, you can just create a backup branch. GitKraken provides the handy Undo button that lets you revert most things you do with a simple button klick. The previous state without damaging the path back to the current state.įirst of all, you can always go back. but none of those titles convince me that I'm going to get to look at
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |