Skip to main content

While Checkout a branch files as been deleted, retrieve those files from a repository

Hi friends,

I have faced some critical case in git. Initial I have three branches master, dev, staging. In dev and staging branches I have followed all the commits up to date. I have followed these steps regularly for each and every process (For branching strategy). All the initial configuration has been done previously.

  1. git add . (Currently I'm in dev branch)
  2. git commit -m "Commit message"
  3. git push origin dev
  4. git checkout staging
  5. git fetch
  6. git pull origin staging
  7. git merge --no-ff dev
  8. git push origin staging
  9. git checkout dev
I have just maintained the initial commit only in the master branch. One day when I try to checkout master branch, all my changes as been changed to deleted state. I have lost all my changes. I have retrieved my changes by using this command

git reset --hard origin/dev

Just try this command to get you changes back to it.

Comments

Popular posts from this blog

Error: ENOSPC: System limit for number of file watchers reached, watch

 Hi, Dependency version details. node: v15.8.0 nvm: 0.33.2 nodejs: v4.2.6 When I run an "npm start" command I'm getting this error. Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/html/project/simple-mern-project/frontend/public ' Error message: I found the solution from this StackOverflow URL:  https://stackoverflow.com/questions/55763428/react-native-error-enospc-system-limit-for-number-of-file-watchers-reached This is the command, I run to solve the issue:  # insert the new value into the system config echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p # check that the new value was applied cat /proc/sys/fs/inotify/max_user_watches # config variable name (not runnable) fs.inotify.max_user_watches=524288

Install a node & npm specific versions using nvm (Node Version Manager)

Hi buddies, When i tried to install a node & npm in my system, i will be facing some problem with the version. I want to install a recent LTS (Long Term Support) Don't Do (If you want to install a specific version):  I don't know, how its gonna installed, but its not a recent Node LTS version sudo apt-get install nodejs-legacy sudo apt-get install npm Do (Using a NVM- Node Version Manager to install a specific version): Use the following command to install a NVM into your system $ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash Reload the system environment using this command $ source ~/.profile $ source ~/.bashrc List all the nodejs version using this command $ nvm ls-remote Install a nodejs version, what ever you want (If you want to install multiple node version you can install using this command) $ nvm install 6.11.1 $ nvm install 8.2.1 List a node version using this command ...

Inapp Purchase Server side validation for Android as well as IOS using Laravel

Hi friends,                 I'm very happy to share today experience In-app purchase server-side validation you. This link is very use full for me to implement this server side validation. Please refer this link, https://github.com/aporat/store-receipt-validator I have faced some problems with Android server side validation. I will share problematic experience with you.......... https://developers.google.com/android-publisher/authorization  -> go through this URL and flow this steps If you follow the steps, you will get a client id and client secret. While doing this process it will ask you for redirect URI, you just any of your project URL for testing purpose to get the token http://localhost/project/public/refresh-token I Just gave a refresh token function as return URL. In this function, $request->code you can retrieve the refresh token Using this token you can do this process  Exchange this code for an...