So I have changes to my code as I am working locally on a newer version of my project and had to commit my changes so I can pull and merge changes from my master branch (there were minor changes on the master version of the project that I needed to add to my code and they were done by a different developer so they were pushed to the branch directly.
But now I need to access the files (or stage the commits) so I can copy the changes I made (I didn’t push them to the branch) as files. Normally I undo last commit which would return my files to staged changes but I have 3 commits and one of them is a merge commit (merge code from master to my code locally).
How can I access my files without deleting the changes?
2
Answers
So basically few commands you can check:
you can do soft(after reset will keep changes locally) reset
you can do hard(after reset will NOT keep changes locally) reset
PS:
If you want to stash your changes locally and take a pull and if all fine apply your stash changes.
if you want to show all stash list
if you want to apply the stash changes:
But what you have done if I understood correctly:
Try these and please read a bit about it.
If you want to inspect the content of a file in a given commit without checking out that file, you can use
git show
: