How To Lose Data With Git Reset

1. steps/notes

  1. you commit a file
  2. you change a tracked file (file already commited) in the working area and do not commit it the change
  3. you run git reset --hard
  • the branch is moved to the HEAD
  • the state HEAD of that move is copied both to the index and the working area
  • if you made any changes to either working area/index, that’s all irreversibly lost
  • intentionally, it is a nice way to discard your changes, or course :)
  • rule: no commit, no restore

--

--

--

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

My hands-on experience with HTML and CSS (From a tech journalist to learning first line of code)

Flutter or React Native, a cross-platform dilemma — Serie wrap-up

If you are seeing multiple ads selling similar products or trying to get in front of a specific

30 Best CSS Registration Form Templates 2020

The simple way to do QA (and why you want to).

New 2021 CodeHS Courses

Developer should have a blog

Leaving the Nest: Let your Twitter Bot fly among the clouds

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

More from Medium

How git worktrees enhance your efficiency while also save memory

Python object-oriented programming — Composition over Inheritance

Git : Introduction