The Nautilus application development team was working on a git repository /usr/src/kodekloudrepos/ecommerce present on Storage server in Stratos DC. One of the developers stashed some in-progress changes in this repository, but now they want to restore some of the stashed changes. Find below more details to accomplish this task:
/usr/src/kodekloudrepos/ecommerce git repository, and restore the stash with stash@{1} identifier. Further, commit and push your changes to the origin.Login into storage server and move into repository
sudo -i
cd /usr/src/kodekloudrepos/ecommerce
Let’s check the stash list:
git stash list
[root@ststor01 ecommerce]# git stash list
stash@{0}: WIP on master: 7fe985d initial commit
stash@{1}: WIP on master: 7fe985d initial commit
Restart stash files
git stash apply stash@{1}
Push changes
git add .
git commit -m "Restored stash files"
git push
git stash or git stash push -m "message"git stash list - Show all stashesgit stash apply stash@{n} - Restore without removinggit stash pop - Apply and remove latest stashgit stash push -p for partial stashinggit stash drop stash@{n} to remove stashgit stash -u includes new filesgit stash -a includes ignored filesgit stash branch name creates branchgit stash show -p stash@{n} displays diff